Skip to content

Use Object.prototype.hasOwnProperty.call(a, b) instead of a.hasOwnProperty(b) #5358

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

Merged

Conversation

ClaireNeveu
Copy link
Contributor

@ClaireNeveu ClaireNeveu commented Jan 21, 2022

Resolves #5357

This is my first contribution to the project so apologies if I've checked in the wrong files or there is some other changes that need to be made. Let me know and I'll adjust the PR accordingly.

…perty(b)

Signed-Off-By: Claire E. Neveu <claire@therecount.com>
@ClaireNeveu ClaireNeveu force-pushed the claire/fix-object-equality branch from 101a391 to f51067a Compare January 21, 2022 19:33
@bobzhang
Copy link
Member

bobzhang commented May 5, 2022

@ClaireNeveu Sorry I was on leave for several months. Would you add some comment why it makes a difference?

@ClaireNeveu ClaireNeveu force-pushed the claire/fix-object-equality branch from cd6120e to ca1e589 Compare May 5, 2022 18:46
@ClaireNeveu
Copy link
Contributor Author

@bobzhang I added a comment to the new external declaration explaining why it's necessary to call the function directly instead of via the prototype chain.

@bobzhang bobzhang merged commit d509e7e into rescript-lang:master May 7, 2022
@ClaireNeveu ClaireNeveu deleted the claire/fix-object-equality branch May 7, 2022 01:21
@ClaireNeveu
Copy link
Contributor Author

@bobzhang Thank you for getting this merged in!

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

Successfully merging this pull request may close these issues.

Equality fails for objects with no prototype
2 participants