Skip to content

Unable to extend classes which constructors require new when targeting es5 #11304

Closed
@falsandtru

Description

@falsandtru

TypeScript Version: master

Code

new class extends Map {}();

Expected behavior:

$ node built/local/tsc.js -t es5 --lib es6 index.ts && node index.js

Actual behavior:

$ node built/local/tsc.js -t es5 --lib es6 index.ts && node index.js
...\index.js:9
        return _super.apply(this, arguments) || this;
                      ^

TypeError: Constructor Map requires 'new'

Metadata

Metadata

Assignees

No one assigned

    Labels

    SuggestionAn idea for TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions