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

Fix dates always being equal #596

Closed
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@tesk9

tesk9 commented May 12, 2016

Fixes #468

Adds tests for Date around equality.

Show outdated Hide outdated src/Native/Utils.js
if (x instanceof Date && y instanceof Date)
{
if (x.valueOf() !== y.valueOf())
{ return false; }

This comment has been minimized.

@eeue56

eeue56 May 12, 2016

Contributor

Evan's preferred format is to stick the return on the next line too, then align the closing bracket with the first

@eeue56

eeue56 May 12, 2016

Contributor

Evan's preferred format is to stick the return on the next line too, then align the closing bracket with the first

This comment has been minimized.

@eeue56

eeue56 May 12, 2016

Contributor

also for what it's worth, I think you should probably just do return x.valueOf() === y.valueOf() since there's no point doing anything else.

@eeue56

eeue56 May 12, 2016

Contributor

also for what it's worth, I think you should probably just do return x.valueOf() === y.valueOf() since there's no point doing anything else.

This comment has been minimized.

@tesk9

tesk9 May 13, 2016

I added a test for the tempting return x.valueOf === thing. It's in a while statement, so returning true could lead to false equality for complex structures.

@tesk9

tesk9 May 13, 2016

I added a test for the tempting return x.valueOf === thing. It's in a while statement, so returning true could lead to false equality for complex structures.

@eeue56

This comment has been minimized.

Show comment
Hide comment
@eeue56

eeue56 May 21, 2016

Contributor

👍

Contributor

eeue56 commented May 21, 2016

👍

@evancz evancz closed this in 7eb27a1 Jun 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment