Bug 65885 - Array.prototype.indexOf called on undefined should throw
: Array.prototype.indexOf called on undefined should throw
Status: RESOLVED DUPLICATE of bug 64679
: WebKit
JavaScriptCore
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2011-08-08 15:56 PST by
Modified: 2011-08-09 09:51 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2011-08-08 15:56:28 PST
[].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
------- Comment #1 From 2011-08-08 15:59:12 PST -------
Current behavior: JSC returns -1. V8 throws TypeError.
------- Comment #2 From 2011-08-09 09:51:31 PST -------

*** This bug has been marked as a duplicate of bug 64679 ***