Closed
Bug 1552022
Opened 6 years ago
Closed 6 years ago
Synthesized constructors for derived classes ignore all arguments (with fields and no constructor() method)
Categories
(Core :: JavaScript Engine, task, P1)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla68
| Tracking | Status | |
|---|---|---|
| firefox68 | --- | fixed |
People
(Reporter: jorendorff, Assigned: khyperia)
References
Details
Attachments
(1 file)
Ashley noticed this.
class B {
constructor(x) {
console.log(x);
}
}
class C extends B {
}
new C("C"); // prints "C"
class D extends B {
asdf = 2;
}
new D("D"); // prints undefined :'(
The synthesized constructor should do super(...args), but currently it just does super().
| Reporter | ||
Updated•6 years ago
|
Priority: -- → P1
| Reporter | ||
Updated•6 years ago
|
Summary: Arguments are ignored in derived-class synthesized constructors → Synthesized constructors for derived classes ignore all arguments (with fields and no constructor() method)
| Assignee | ||
Comment 1•6 years ago
|
||
Pushed by ahauck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3944c733e417
Pass through arguments in synthesized constructors for derived classes. r=jorendorff
Comment 3•6 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox68:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Updated•6 years ago
|
Assignee: nobody → khyperia
You need to log in
before you can comment on or make changes to this bug.
Description
•