On 22 Aug 2008, at 19:28, David-Sarah Hopwood wrote: > Jason Orendorff wrote: >> On Fri, Aug 22, 2008 at 6:22 AM, Sam Ruby <[EMAIL PROTECTED]> >> wrote: >>> On Fri, Aug 22, 2008 at 2:30 AM, Jason Orendorff >>> <[EMAIL PROTECTED]> wrote: >>>> var a = []; >>>> a[0] = "first"; >>>> a[0.0m] = "second"; // a second property? >>>> a[0.000m] = "third"; // a third? >>> [...] >>> >>> It seems to me that if trailing zeros are retained in a call to >>> ToString, then to be consistent with ES3, the three assignments >>> above >>> would produce three properties. And if trailing zeros are lost, you >>> would expect to only have one. Both approaches are internally >>> consistent, and it surprises me to see either one characterized as >>> "breaking" array lookup. >> >> Well, the intuition is that two equal numbers should index the same >> property. This is an invariant in ES3 and it makes a lot of sense. > > Two values that are === should index the same property [*].
> [*] but not conversely: two values that index the same property are > not necessarily ===. That highly desirable, but not true, as my earlier message illustrates. In ES3 the ToString operator on Numbers is not required to be a true function in the sense of always yielding the same result for the same input. drj _______________________________________________ Es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

