Skip to content

ES5 run-time for "extends" keyword incompatible with ES6 #19525

@mindplay-dk

Description

@mindplay-dk

The ES5 transpiled output from the Typescript compiler for the extends keyword isn't consistent with the current standard behavior of ES6 Javascript, and also isn't consistent with the way Typescript checks the types at compile-time.

Code

class List extends Array { }

alert(new List instanceof List);

Try it on the playground where the code is transpiled to ES5 by default.

Expected behavior:

An alert showing true.

Actual behavior:

An alert showing false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions