Skip to content

Conversation

agirorn
Copy link
Contributor

@agirorn agirorn commented Apr 24, 2017

Should fix #47

index.js Outdated
}

function isError (x) {
return x instanceof Error;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main issue is that this won’t work across realms, and it will fail on an Error that has had its [[Prototype]] changed.

index.js Outdated
return true;
}
if (isError(a)) {
if (!isError(b)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won’t work right if the first is not an error but the second is

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased on top of #58, and preserved your unique test case.

@ljharb ljharb merged commit c0ae38c into inspect-js:master Aug 10, 2019
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

Successfully merging this pull request may close these issues.

Two different Errors are considered equal
4 participants