Make super() throw after evaluating args
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: yulia, Assigned: anba)
Details
Attachments
(3 files)
As discussed at tc39:
Further details: https://github.com/tc39/ecma262/issues/1351
Extending null has a different behavior depending on if you use class syntax or setPrototypeOf.
we currently throw BEFORE evaluating args on super, we will need to throw AFTER evaluating args on super.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Modify JSOp::SuperFun to only retrieve the prototype without any further checks.
Drive-by change:
Take advantage that the object whose prototype gets retrieved is guaranteed to
be a JSFunction, so we neither have to worry about proxy objects nor lazy
prototypes.
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D60677
Assignee | ||
Comment 3•4 years ago
|
||
The [[HomeObject]] slot is guaranteed to either contain a JSFunction or a
PlainObject, so we can use safely use JSObject::staticPrototype()
to retrieve
the prototype and can also remove the lazy-proto handling in the compilers.
Depends on D60678
Pushed by apavel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c79dd9a939fd Part 1: Don't throw for non-constructors in JSOp::SuperFun. r=jandem https://hg.mozilla.org/integration/autoland/rev/dc2a6717541a Part 2: Remove unnecessary rooting in JSOp::InitHomeObject interpreter implementation. r=jandem https://hg.mozilla.org/integration/autoland/rev/b77cdd2e0b00 Part 3: Remove lazy-proto code paths from JSOp::SuperBase implementations. r=jandem
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c79dd9a939fd
https://hg.mozilla.org/mozilla-central/rev/dc2a6717541a
https://hg.mozilla.org/mozilla-central/rev/b77cdd2e0b00
Description
•