Closed
Bug 1535471
Opened 5 years ago
Closed 5 years ago
Class field initializers need to use JSOP_INITPROP and friends, not JSOP_SETPROP
Categories
(Core :: JavaScript Engine, enhancement, P1)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla68
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: jorendorff, Assigned: khyperia)
References
Details
Attachments
(1 file)
Initializing properties should never trigger base-class setters, like:
let id = Symbol();
class Base {
set x(v) { throw new Error("failed"); }
set [id](v) { throw new Error("failed"); }
}
class X extends Base {
x = 1;
[id] = 2;
}
let x = new X();
assertEq(x.x, 1);
assertEq(x[id], 2);
Right now, we're using JSOP_SETPROP
in the initializer for the field x
; that needs to be JSOP_INITPROP
(but check the spec to make sure). Or in the indexed-property or computed-property-name case, JSOP_INITELEM
.
Reporter | ||
Updated•5 years ago
|
Priority: -- → P1
Assignee | ||
Updated•5 years ago
|
Assignee: nobody → khyperia
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•5 years ago
|
||
Pushed by ahauck@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8457ce7cc442 Use JSOP_INITPROP for field initializers. r=jorendorff
Comment 3•5 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox68:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in
before you can comment on or make changes to this bug.
Description
•