RESOLVED DUPLICATE of bug 64679 65885
Array.prototype.indexOf called on undefined should throw
https://bugs.webkit.org/show_bug.cgi?id=65885
Summary Array.prototype.indexOf called on undefined should throw
Paul Irish
Reported 2011-08-08 15:56:28 PDT
[].indexOf.call(undefined, 6); ^ should throw a TypeError according to spec.... from: http://es5.github.com/#x15.4.4.14 1. Let O be the result of calling ToObject passing the `this` value as the argument. and from the ToObject definition http://es5.github.com/#x9.9 ... if ArgumentType is Undefined, then Throw a TypeError exception
Attachments
Paul Irish
Comment 1 2011-08-08 15:59:12 PDT
Current behavior: JSC returns -1. V8 throws TypeError.
Mark Hahnenberg
Comment 2 2011-08-09 09:51:31 PDT
*** This bug has been marked as a duplicate of bug 64679 ***
Note You need to log in before you can comment on or make changes to this bug.