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

[Breaking] ensure `Error` objects compare properly #58

Merged
merged 1 commit into from Aug 10, 2019

Conversation

@khirayama
Copy link
Contributor

commented Apr 18, 2018

I tried to support Error object. It is easy to cover almost all cases.
But it is too difficult to make sure that supporting current supported browsers and nodejs.

Refs:


I felt we should avoid to support to compare Error objects.
We might better to put some comments on README.md about that.


Fixes #47.
Almost same solution: #48

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

function isError(value) {
return value instanceof Error;

This comment has been minimized.

Copy link
@ljharb

ljharb Jul 31, 2019

Collaborator

this won't work cross-realm, i'm afraid.

@ljharb ljharb force-pushed the khirayama:feature/support-errors branch from eaa2992 to bffc3d3 Jul 31, 2019

@@ -59,6 +59,13 @@ function objEquiv(a, b, opts) {

if (isArguments(a) !== isArguments(b)) { return false; }

var aIsError = a instanceof Error;

This comment has been minimized.

Copy link
@ljharb

ljharb Jul 31, 2019

Collaborator

rebased and tweaked; here's where this isn't a reliable cross-realm check.

@ljharb ljharb changed the title Support to compare Error objects [Breaking] ensure `Error` objects compare properly Jul 31, 2019

@ljharb ljharb force-pushed the khirayama:feature/support-errors branch from bffc3d3 to ffb2522 Aug 9, 2019

@ljharb

ljharb approved these changes Aug 9, 2019

Copy link
Collaborator

left a comment

I'm going to get this in anyways, despite the lack of a cross-realm brand check.

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@khirayama khirayama deleted the khirayama:feature/support-errors branch Aug 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.