New Test262 Tests target-super-identifier-reference-null.js and target-super-computed-reference-null.js fail
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox92 | --- | fixed |
People
(Reporter: mgaudet, Assigned: anba)
Details
Attachments
(4 files)
I am working on importing an updated copy of test262. The following two tests fail on central:
test262/language/expressions/assignment/target-super-identifier-reference-null.js
test262/language/expressions/assignment/target-super-computed-reference-null.js
with the error message uncaught exception: Test262Error: Expected SameValue(«0», «1») to be true
Comment 1•3 years ago
|
||
The code looks like this:
var count = 0;
class C {
static m() {
super.x = count += 1;
}
}
Object.setPrototypeOf(C, null)
C.m();
I think the problem here is that we emit SuperBase too soon:
0000: FunctionThis # THIS
00001: SetLocal 0 # THIS
00005: Pop #
main:
00006: GetLocal 0 # this
00010: Callee # this CALLEE
00011: SuperBase # this HOMEOBJECTPROTO
00012: BindGName "count" # this HOMEOBJECTPROTO GLOBAL
00017: GetGName "count" # this HOMEOBJECTPROTO GLOBAL count
00022: One # this HOMEOBJECTPROTO GLOBAL count 1
00023: Add # this HOMEOBJECTPROTO GLOBAL (count += 1)
00024: StrictSetGName "count" # this HOMEOBJECTPROTO (count += 1)
00029: StrictSetPropSuper "x" # (count += 1)
00034: Pop #
00035: RetRval #
The spec expects us to do something more like this:
BindGName "count" # GLOBAL
GetGName "count" # GLOBAL count
One # GLOBAL count 1
Add # GLOBAL (count += 1)
StrictSetGName "count" # (count += 1)
GetLocal 0 # (count += 1) this
Callee # (count += 1) this CALLEE
SuperBase # (count += 1) this HOMEOBJECTPROTO
Pick 2 # this HOMEOBJECTPROTO (count += 1)
StrictSetPropSuper "x" # (count += )1
I don't know the frontend well enough to know where to fix this.
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
This check is no longer needed after https://github.com/tc39/ecma262/pull/2267/.
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
That way it's easier to compare the super and non-super operations.
Depends on D120609
Assignee | ||
Comment 4•3 years ago
|
||
The PR removes the RequireObjectCoercible()
call in MakeSuperPropertyReference
,
which means JSOp::SuperBase
should no longer throw when the prototype is null
.
Depends on D120610
Assignee | ||
Comment 5•3 years ago
|
||
Depends on D120611
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/fa231d611193 Part 1: Remove no longer needed CheckObjCoercible. r=iain https://hg.mozilla.org/integration/autoland/rev/7dbf83e48430 Part 2: Align super and non-super property operations in the interpreter. r=iain https://hg.mozilla.org/integration/autoland/rev/561144893879 Part 3: Don't throw for null-proto in JSOp::SuperBase. r=iain https://hg.mozilla.org/integration/autoland/rev/18be06839d58 Part 4: Remove unused local variables. r=iain
Comment 7•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fa231d611193
https://hg.mozilla.org/mozilla-central/rev/7dbf83e48430
https://hg.mozilla.org/mozilla-central/rev/561144893879
https://hg.mozilla.org/mozilla-central/rev/18be06839d58
Description
•