Synthesized constructors for derived classes ignore all arguments (with fields and no constructor() method)

RESOLVED FIXED in Firefox 68

Status

()

task
P1
normal
RESOLVED FIXED
Last month
Last month

People

(Reporter: jorendorff, Assigned: khyperia)

Tracking

(Blocks 1 bug)

unspecified
mozilla68
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment)

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

Last month
Priority: -- → P1
Reporter

Updated

Last month
Summary: Arguments are ignored in derived-class synthesized constructors → Synthesized constructors for derived classes ignore all arguments (with fields and no constructor() method)

Comment 2

Last month
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

Last month
bugherder
Status: NEW → RESOLVED
Closed: Last month
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Assignee: nobody → khyperia
You need to log in before you can comment on or make changes to this bug.