Closed
Description
TypeScript Version: 2.1.0-dev.20161104
Code
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs"
}
}
// A *self-contained* demonstration of the problem follows...
class Test extends Error {
constructor(message: string) {
super(message);
}
}
const test = new Test("test");
console.log(`Instance of error: ${test instanceof Error}`);
console.log(`Instance of test: ${test instanceof Test}`);
Expected behavior:
Instance of error: true
Instance of test: true
Actual behavior:
Instance of error: true
Instance of test: false
It works with TS 2.0.7