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

Handle NaN correctly in bindings #1811

Merged
merged 1 commit into from
Jun 11, 2015
Merged

Conversation

dfreedm
Copy link
Member

@dfreedm dfreedm commented Jun 9, 2015

Fixes #1799

// NaN is always not equal to itself,
// if old and value are both NaN we treat them as equal
// x !== x is 10x faster, and equivalent to isNaN(x)
if (old !== value && !(old !== old && value !== value)) {
Copy link
Member

Choose a reason for hiding this comment

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

Seems like (old !== value && (old==old || value==value)) is slightly more readable.

Make our own equality check for NaN that uses the identity-check failure

Fixes #1799
@dfreedm
Copy link
Member Author

dfreedm commented Jun 10, 2015

Tests are passing in VMs, not sure what is going on in Sauce.

@kevinpschaaf
Copy link
Member

LGTM, confirmed min perf impact

kevinpschaaf added a commit that referenced this pull request Jun 11, 2015
@kevinpschaaf kevinpschaaf merged commit 1cad7b0 into master Jun 11, 2015
@kevinpschaaf kevinpschaaf deleted the handle-nan-in-bindings branch June 11, 2015 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants