> Mike Cowlishaw wrote:
> > Seems to me the problem here is not decimal (or binary)
representations
> > but arrays (consider a(0.0) and a("0.0")).
> >
> > In effect the array definition in ES3 says -- in a rather roundabout
way
> > -- that all indexes must be an integer (which fits in 32 bits if
encoded
> > in binary). So, as long as there's a toInt32 in there, decimals with
> > trailing zeros after the point are just fine. In other words the
> > processing of array indexes could (conceptually) be
> > toString->toNumber->toInt32 (or something like that).
>
> That's incompatible with ES3. There is no toInt in there.
I confess it's eight years since I looked at that text, but I wasn't
saying there was a toInt32 in ES3. I'm just saying that that could/should
be added. Surely there was something about array indexes having to have
the same result as though it had a toInt32? Anything else that wouldn't
convert to an integer would be 'out of range'?
ES arrays are essentially just like Java arrays -- indexed by integers,
zero through length-1?
Mike
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss