Closed Bug 1176396 Opened 9 years ago Closed 9 years ago

Set doesn't throw an error when called as a function

Categories

(Core :: JavaScript Engine, defect, P4)

38 Branch
All
Unspecified
defect

Tracking

()

RESOLVED DUPLICATE of bug 1083752

People

(Reporter: contact, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0
Build ID: 20150511103303

Steps to reproduce:

var set = Set("abc");


Actual results:

Set was called as a function and it appears to create a Set object, just like if it was called with the keyword `new`.


Expected results:

According to the EcmaScript 6 standard, Set must not be called as a function and it should throw an error whenever that action is performed.

http://people.mozilla.org/~jorendorff/es6-draft.html#sec-set-constructor

The Set constructor is the %Set% intrinsic object and the initial value of the Set property of the global object. When called as a constructor it creates and initializes a new Set object. Set is not intended to be called as a function and will throw an exception when called in that manner.
Severity: normal → major
Priority: -- → P4
Hardware: Unspecified → All
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.