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

Firefox InternalError #15

Open
ljharb opened this issue Oct 23, 2024 · 2 comments
Open

Firefox InternalError #15

ljharb opened this issue Oct 23, 2024 · 2 comments

Comments

@ljharb
Copy link
Member

ljharb commented Oct 23, 2024

This error type isn't part of any spec, and is not instanceof Error, but should probably return true for Error.isError().

@dminor @codehag, any thoughts about perhaps making confirming that InternalError is a true subclass of Error, so that it Just Works with this proposal?

cc @nicolo-ribaudo

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Oct 23, 2024

Weird, MDN says that it's already a subclass of Error:

Also inherits instance properties from its parent Error.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError#instance_properties

@ljharb
Copy link
Member Author

ljharb commented Oct 23, 2024

Ah, you're right, my mistake. These are all true:

  • InternalError.prototype.__proto__ === Error.prototype
  • InternalError.__proto__ === Error
  • new InternalError() instanceof Error

which suggests that Firefox can make Error.isError(new InternalError()) === true, that everything's fine.

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

2 participants