Bug 65885
Summary: | Array.prototype.indexOf called on undefined should throw | ||
---|---|---|---|
Product: | WebKit | Reporter: | Paul Irish <paulirish> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | mhahnenberg |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Paul Irish
[].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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Paul Irish
Current behavior: JSC returns -1. V8 throws TypeError.
Mark Hahnenberg
*** This bug has been marked as a duplicate of bug 64679 ***