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

Not all Errors are equal. #48

Merged
merged 2 commits into from Aug 10, 2019

Conversation

@agirorn
Copy link
Contributor

commented Apr 24, 2017

Should fix #47

index.js Outdated
@@ -40,6 +40,10 @@ function isBuffer (x) {
return true;
}

function isError (x) {
return x instanceof Error;

This comment has been minimized.

Copy link
@ljharb

ljharb Aug 1, 2019

Collaborator

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
@@ -66,6 +70,14 @@ function objEquiv(a, b, opts) {
}
return true;
}
if (isError(a)) {
if (!isError(b)) {

This comment has been minimized.

Copy link
@ljharb

ljharb Aug 1, 2019

Collaborator

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

@ljharb ljharb force-pushed the agirorn:no-all-errors-are-equal branch from ea7a99a to c0ae38c Aug 9, 2019

@ljharb

ljharb approved these changes Aug 9, 2019

Copy link
Collaborator

left a comment

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

@ljharb ljharb merged commit c0ae38c into substack:master Aug 10, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.