Skip to content

Code Generation - Line omitted from class constructor.  #49854

Closed
@troppoli

Description

@troppoli

Bug Report

Emitted javascript omits a line of code that should be be there.

🔎 Search Terms

Code Generation, omitted line, missing, super

🕗 Version & Regression Information

This issues does not happen in 4.6.4, but does ever after.

  • This changed between versions 4.6.4 and 4.7.4

⏯ Playground Link

Playground link with relevant code

💻 Code

class Base{
}

export class Foo extends Base{
    constructor(
        private member: boolean,
    ) {
        'ngInject';
        super();
        console.log(' where did this go???'); // <<<<< this line gets omitted in generated javascript code
    }
}

🙁 Actual behavior

Javascript output does not include the console.log statement.

class Base {
}
export class Foo extends Base {
    constructor(member) {
        'ngInject';
        super();
        this.member = member;
    }
}

🙂 Expected behavior

All the code should make it through. If you duplicate the log line, then one of them will come through.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions