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

equal: Maybe use the SameValue algorithm instead of === #116

Closed
papandreou opened this issue Jan 18, 2015 · 2 comments
Closed

equal: Maybe use the SameValue algorithm instead of === #116

papandreou opened this issue Jan 18, 2015 · 2 comments

Comments

@papandreou
Copy link
Member

The SameValue algorithm used by Object.is differs from the strict equality comparison in some edge cases:

  • NaN is considered equal to NaN
  • -0 and 0 are not considered equal

Judging from chaijs/chai/issues/223 this seems to be more in line with what you'd want from an assertion lib.

@sunesimonsen
Copy link
Member

Sounds like a good idea.

papandreou added a commit that referenced this issue Feb 4, 2015
…eviously used.

This affects the 'to be' and 'to equal' assertions and means that NaN is considered equal to itself, whereas -0 and 0 are considered different.

Closes #116.
papandreou added a commit that referenced this issue Mar 2, 2015
…eviously used.

This affects the 'to be' and 'to equal' assertions and means that NaN is considered equal to itself, whereas -0 and 0 are considered different.

Closes #116.
@sunesimonsen
Copy link
Member

Merged to v6

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