Skip to content

instanceof + extended native class #13735

Closed
@GordonSmith

Description

@GordonSmith

TypeScript Version: 2.1.4

class MyC extends Error {
    constructor(msg: string) {
        super(msg);
    }
}

let myC = new MyC("Hmmm");
let test3 = myC instanceof Error;   //TRUE
let test4 = myC instanceof MyC;     //!!!FALSE!!!

Expected behavior: test4 should be TRUE

Actual behavior: test4 is FALSE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions