Skip to content

es3/es5 inheritance bug #33023

Closed
Closed
@elderapo

Description

@elderapo

TypeScript Version: all versions

Search Terms: es3 es5 inheritance bug

Code

class SomeClass extends Object {}

const instance = new SomeClass();

console.log(instance instanceof SomeClass);
console.log(instance instanceof Object);

Expected behavior:
For every compilation target desired output is:

true
true

Actual behavior:
If the compilation target is set to es3 or es5:

false
true

Playground Link: https://typescript-play.js.org/?target=1#code/MYGwhgzhAEDKD2BbApgYXFayAeAXZAdgCYwDyARgFbLC7QDeAvgFAD0r0okMCK63DFs2DwCEOvGgBeaAWQB3OEjQYIACgCUAbmbDREeCGQA6EPADmayQEsxuMAWDJ4AMyV9V2vWMMmzlmzsHJ1doCmpaDSA

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