On Sun, 08 May 2011 00:20:35 +0200, J.R. <[email protected]> wrote:

After scratching my head for a while, I've found a bug in Google Chrome
(latest version 11):

[0, false, 15].indexOf(false); // should return 1, but it returns 0;

I'm unable to reproduce this. Can you say a little more about what
you are doing, and how you execute the code above?

I've just installed Chrome 11.0.696.65 (Linux) and when I execute
 [0,false,15].indexOf(false)
it evaluates to 1.
Ditto in version 12.0.742.30 dev-m (Windows), and also in the old
version 9 I had on Linux before I updated it.

In Firefox 4, the test above returns 1 (the correct result).

I guess Google Chrome is testing the array for the searchElement existence
using the '==' operator instead of the Strict Equals Operator (===).
Therefore, Chrome is not compliant with ECMA-262 5th ed., 15.4.4.14.

Not according to the source code, and it hasn't changed recently. ;)

/L
--
Lasse Reichstein Holst Nielsen - [email protected]

--
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to