Skip to content

Incorrect emit for ES6 export default class with static initializers #5136

Description

@rbuckton

Given the following TypeScript:

export default class {
  static x = 1;
}

We emit the following JavaScript:

export default class {
}
default_1.x = 1; // TypeError: Cannot set property 'x' of undefined

Where we should emit the following instead:

export default class default_1 { // generated
}
default_1.x = 1;

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions