=== again (sorry)

Igor Bukanov igor at mir2.org
Thu Nov 13 09:18:26 PST 2008


2008/11/11 Waldemar Horwat <waldemar at google.com>:
> Mark S. Miller wrote:
>>
>> The indexOf and lastIndexOf methods are new in ES3.1, and are the only
>> methods in the entire spec that depend on ===.
>
> Strictly speaking that's true, but only because the switch statement is not
> a method.  switch statements depend on ===.

There was a recently reported bug for SpiderMonkey where the
implementation treated -0 as not equal to 0 for some optimized switch
cases. Given that the bug was present in the code at least since 1998
this gives indications that even for a switch a change to use
Object.identical, not ===, could be compatible with the web.

Regards, Igor


More information about the Es-discuss mailing list