tc39 / proposal-is-error

ECMAScript Proposal, specs, and reference implementation for Error.isError
https://tc39.es/proposal-is-error/
MIT License
85 stars 2 forks source link

Firefox `InternalError` #15

Open ljharb opened 4 weeks ago

ljharb commented 4 weeks ago

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 commented 4 weeks ago

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 commented 4 weeks ago

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

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