Closed
Bug 1215341
Opened 7 years ago
Closed 7 years ago
Make assignment to const throw runtime TypeError regardless of strictness
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: shu, Assigned: shu)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
33.29 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
17.69 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
9.96 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
Per ES6.
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8674622 -
Flags: review?(jdemooij)
Assignee | ||
Comment 2•7 years ago
|
||
Attachment #8674623 -
Flags: review?(jdemooij)
Assignee | ||
Comment 3•7 years ago
|
||
Attachment #8674624 -
Flags: review?(jdemooij)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → shu
Status: NEW → ASSIGNED
Updated•7 years ago
|
Attachment #8674622 -
Flags: review?(jdemooij) → review+
Comment 4•7 years ago
|
||
Comment on attachment 8674623 [details] [diff] [review] Make assignment to const errors runtime TypeErrors in the JITs. Review of attachment 8674623 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jit/MIR.h @@ +7277,4 @@ > { > + unsigned errorNumber_; > + > + MThrowRuntimeLexicalError(unsigned errorNumber) Nit: `explicit`
Attachment #8674623 -
Flags: review?(jdemooij) → review+
Comment 5•7 years ago
|
||
Comment on attachment 8674624 [details] [diff] [review] Update tests. Review of attachment 8674624 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jit-test/tests/basic/constAssignError.js @@ +8,5 @@ > > +assertTypeError("(function() { const x = 3; (function() x++)(); return x })()"); > +assertTypeError("(function() { const x = 3; (function() x++)(); return x++ })()"); > +assertTypeError("(function() { const x = 2; (function() x++)(); return ++x })()"); > +assertTypeError("(function() { const x = 2; (function() x++)(); return x += 1 })()"); While you're fixing this test, would you mind changing (4 times) (function() x++) to (() => x++) No deprecated syntax and nice to have a test for assigning to consts in arrows.
Attachment #8674624 -
Flags: review?(jdemooij) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/99fb98710182 https://hg.mozilla.org/integration/mozilla-inbound/rev/731543183177 https://hg.mozilla.org/integration/mozilla-inbound/rev/3664bbd6853b
Comment 7•7 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/99fb98710182 https://hg.mozilla.org/mozilla-central/rev/731543183177 https://hg.mozilla.org/mozilla-central/rev/3664bbd6853b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•