-
Notifications
You must be signed in to change notification settings - Fork 39
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
eql({}, null) throws WeakMap key error #33
Labels
Comments
Seems this could be fixed by checking both sides in the entry point: // Primitives/null/undefined can be checked for referential equality; returning early
if (
typeof leftHandOperand !== 'object' ||
leftHandOperand === null ||
leftHandOperand === undefined || // eslint-disable-line no-undefined
typeof rightHandOperand !== 'object' ||
rightHandOperand === null ||
rightHandOperand === undefined // eslint-disable-line no-undefined
) {
return leftHandOperand === rightHandOperand;
} Any reason not to? |
This was referenced Nov 14, 2016
Thanks for the issue @STRML, also thanks for the proposed solution. Seems completely reasonable to me, if you'd like to write a PR with your proposed solution and some tests, that'd be aaawwwesome! 😝 Edit: nvm, I see you have made one! Thanks, I'll review it 😄 |
Thanks for your work @STRML! Great job 😄 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple reproduction:
The text was updated successfully, but these errors were encountered: