Hey JR, Just wanted to confirm what others are saying. It returned 1 for me as well. I also tried this: Array.prototype.indexOf.call([0, false, 15] , false); and it also returned 1 (though why wouldn't it, if the other one did). I'm really interested to see you solve this mystery though, because I can see any obvious way you could have made a mistake. Best of luck. -Nate
On Sat, May 7, 2011 at 4:42 PM, Lasse Reichstein <[email protected] > wrote: > 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] > -- 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]
