Closed
Bug 641606
Opened 14 years ago
Closed 14 years ago
A bunch of prototype method don't throw when used as a constructor
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 202019
People
(Reporter: bruant.d, Unassigned)
Details
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: FF4RC1
Test case
------------
new Array.prototype.slice;
------------
Same issue with String.prototype.slice.
Also, the error message for a couple of others isn't clear.
With Array.prototype.{map|forEach}, a TypeError is thrown when no argument is passed, however, when the right arguments are passed, no error is thrown.
This has been discovered thanks to test262 - Test S15.4.4.10_A5.7 "If property does not implement the internal [[Construct]] method, throw a TypeError exception"
For normative reference: ES5.1 section 15 Standard Built-in ECMAScript Objects:
"None of the built-in functions described in this clause that are not constructors shall implement the [[Construct]] internal method unless otherwise specified in the description of a particular function."
And in 11.2.2 The new Operator:
"If constructor does not implement the [[Construct]] internal method, throw a TypeError exception."
Reproducible: Always
Updated•14 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•