Closed
Bug 1156808
Opened 9 years ago
Closed 9 years ago
Object.assign throws strict mode error for readonly properties in non strict mode.
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: john.david.dalton, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36 Steps to reproduce: When not in strict mode: var o = { 'a': 1 }; Object.freeze(o); Object.assign(o, { 'a': 2 }); // TypeError: "a" is read-only Actual results: Throws a TypeError: "a" is read-only Expected results: Silent fail to assign.
Reporter | ||
Comment 1•9 years ago
|
||
This happens in Nightly but not stable 37.
Reporter | ||
Updated•9 years ago
|
Summary: Object.assign → Object.assign throws strict mode error for readonly properties in non strict mode.
Updated•9 years ago
|
Component: Untriaged → JavaScript: Standard Library
Product: Firefox → Core
Comment 2•9 years ago
|
||
Nightly is correct, see 19.1.2.1 Step 5.c.iii.3. It calls Set with the "Throw" parameter set to true.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 3•9 years ago
|
||
Ah ok thanks!
You need to log in
before you can comment on or make changes to this bug.
Description
•