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
.
-Original Message-
From: [EMAIL PROTECTED] [mailto:es-discuss-
[EMAIL PROTECTED] On Behalf Of Igor Bukanov
Sent: Thursday, November 13, 2008 9:18 AM
To: Waldemar Horwat
Cc: Mark S. Miller; es-discuss
Subject: Re: === again (sorry)
2008/11/11 Waldemar Horwat [EMAIL PROTECTED]:
Mark S. Miller wrote
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 ===.
Waldemar
Erik Arvidsson wrote:
I see a small risk with changing this. Array.prototype.indexOf is widely
emulated in IE and is also used a lot in browser that support it.
If it is emulated, then the emulation will replace the ES3.1 version,
so there can be no compatibility problem in that case.
Overall
Re: === again (sorry)
I see a small risk with changing this. Array.prototype.indexOf is
widely emulated in IE and is also used a lot in browser that support it.
This change would cause issues with NaN and -0. However I don't think
that changing these 2 edge cases would lead to too many
Maciej Stachowiak wrote:
On Nov 3, 2008, at 11:34 AM, David-Sarah Hopwood wrote:
Erik Arvidsson wrote:
I see a small risk with changing this. Array.prototype.indexOf is widely
emulated in IE and is also used a lot in browser that support it.
If it is emulated, then the emulation will replace
On Nov 3, 2008, at 6:54 PM, David-Sarah Hopwood wrote:
Maciej Stachowiak wrote:
On Nov 3, 2008, at 11:34 AM, David-Sarah Hopwood wrote:
Erik Arvidsson wrote:
I see a small risk with changing this. Array.prototype.indexOf is
widely
emulated in IE and is also used a lot in browser that
I see a small risk with changing this. Array.prototype.indexOf is
widely emulated in IE and is also used a lot in browser that support it.
This change would cause issues with NaN and -0. However I don't think
that changing these 2 edge cases would lead to too many serious issues.
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
9 matches
Mail list logo