-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
Test case:
myError.ts
class MyError extends Error {
constructor(message: string) {
super(message);
}
}
let error = new MyError('Error Message');
console.log(error.message);tsconfig.json
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs"
}
}compile and run using node:
node myError.js
Observe: nothing is printed to the console. Debugging it shows that the message passed to super is not recorded. Something seems very strange with the prototype chain in this case.
I was under the impression from #3516 that this should work now even if generating ES5 code. If not possible for ES5 then the compiler should produce an error.
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code