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
Added isEq to _.isEqual for proper equality checking of 0 and -0 in sets and maps #2508
Conversation
_.isEq(a, b) performs a SameValueZero comparison on values a and b. http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero
…nd maps. Implemented an internal isEq function that is called by deepEq when testing equality of key values for maps or sets. 0 and -0 should be considered equal for set and keys of maps (but not values) which is why this change was needed.
…gs with test case purpose to a couple of tests that were missing them.
Node did not recognize the Set constructor in the test script.
|
@jdalton is any action on my part required? Since the build check that failed seems to be related to Node not recognizing the Set constructor I am assuming no. |
@aebrow4 You should guard those tests on the existence of Set |
@michaelficarra I looked at this for a while but couldn't figure out what I need to do, since all of the tests in object.js are passing and the problem seems to be in a file module.js that is not in the repo. If you could give me more information on what to do that would helpful. |
@aebrow4 You have to wrap the section of the test that mentions |
…the module.js used by Travis CI
@michaelficarra all taken care of now |
Closing because this is only a partial implementation of #2147, and because the the |
This address #2456 and #2507.
I cancelled my last pull request and moved isEq to be an internal function that is included inside of _.isEqual. It will call deepEq to compare object values, which will continue to call eq unless it encounter a set or a map, in which case it will call isEq for proper handling of 0 and -0.