Because of this I have to create custom error with manual adjusting of the prototype. For example
class FooError extends Error {
constructor(m: string) {
super(m);
// Set the prototype explicitly.
Object.setPrototypeOf(this, FooError.prototype);// LINE X
}
sayHello() {
return "hello " + this.message;
}
}
The problem is that plugin (3.0.1 (NetBeans 9.0)) shows me Property 'setPrototypeOf' does not exist on type 'ObjectConstructor'.... at LINE X. I changed code to (<any>Object).setPrototypeOf(this, FooErrorError.prototype) as described here but setPrototypeOf is red color anyway. At the same time I can compile without any problems both variants.
Because of this I have to create custom error with manual adjusting of the prototype. For example
The problem is that plugin (3.0.1 (NetBeans 9.0)) shows me
Property 'setPrototypeOf' does not exist on type 'ObjectConstructor'....
at LINE X. I changed code to(<any>Object).setPrototypeOf(this, FooErrorError.prototype)
as described here butsetPrototypeOf
is red color anyway. At the same time I can compile without any problems both variants.P.S. Thanks a lot for nice plugin!!!