// DO NOT WORK ANY MORE
class FooError extends Error {
constructor(m: string) {
super(m);
}
sayHello() {
return "hello " + this.message;
}
}
// HAS TO BE LIKE THIS FROM NOW ON
class FooError extends Error {
// MAGIC
constructor(m: string) {
super(m);
// Set the prototype explicitly.
Object.setPrototypeOf(this, FooError.prototype);
}
sayHello() {
return "hello " + this.message;
}
}