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)

40 Branch
defect
Not set
normal

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.
This happens in Nightly but not stable 37.
Summary: Object.assign → Object.assign throws strict mode error for readonly properties in non strict mode.
Component: Untriaged → JavaScript: Standard Library
Product: Firefox → Core
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
Ah ok thanks!
You need to log in before you can comment on or make changes to this bug.