Closed Bug 1681567 Opened 4 years ago Closed 4 years ago

Default constructors and spread operations

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: yulia, Assigned: anba)

References

(Blocks 1 open bug, )

Details

Attachments

(3 files)

delete Array.prototype[Symbol.iterator];
new class extends class {} {}

Running this code causes the default class constructor to be overriden by using Symbol.iterator. The change is to Stops delegating to Array.prototype[Symbol.iterator] in a default class constructor.

Priority: -- → P3
Priority: P3 → P2

When bug 762363 originally added this code, JOF_SPREAD didn't yet exist, so
instead we used JOF_BYTE, because the only calls using JOF_BYTE are spread
calls.

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED

Implement the spread iteration changes from https://github.com/tc39/ecma262/pull/2216.

Default derived class constructors are changed to longer use array iteration
in the spread super call super(...args). Instead the contents of the args
array are directly passed through to the super call. In our implementation we
can simply pass the args rest-array to the super call.

Depends on D104405

Second part of the changes from https://github.com/tc39/ecma262/pull/2216.

The TypeError when calling a class constructor is now spec'ed to originate from
the callee realm, so the error code had to be moved after the AutoRealm.

Depends on D104406

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9bbc123e5b38 Part 1: Use IsSpreadOp() to detect spread calls. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/e120285e8bb4 Part 2: No longer execute spread iteration in default derived class constructors. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/78e57707b124 Part 3: Calling class constructors throws from the callee's realm. r=tcampbell
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Regressions: 1691941
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: