Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with manual adjusting of the prototype of the XError #141

Open
PavelTurk opened this issue Oct 12, 2018 · 0 comments
Open

Problem with manual adjusting of the prototype of the XError #141

PavelTurk opened this issue Oct 12, 2018 · 0 comments

Comments

@PavelTurk
Copy link

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.

P.S. Thanks a lot for nice plugin!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant