=== again (sorry)

David-Sarah Hopwood david.hopwood at industrial-designers.co.uk
Fri Oct 31 21:13:28 PDT 2008


Mark S. Miller wrote:
> According to the ES3.1 spec and the behavior of at least FF3.0.3
> 
>     [4, -0, 0, NaN, 8].indexOf(0); // yields 1
>     [4, -0, 0, NaN, 8].indexOf(NaN); // yields -1
> 
> This is because indexOf and lastIndexOf are specified in terms of ===
> rather than SameValue. Is there any reason not to consider this a bug
> that should be fixed? In ES-Harmony, we've agreed that Map lookup will
> be according to SameValue (i.e. Object.eq or Object.identical).
> 
> The indexOf and lastIndexOf methods are new in ES3.1, and are the only
> methods in the entire spec that depend on ===.

In that case it should certainly be fixed.

-- 
David-Sarah Hopwood



More information about the Es-discuss mailing list