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

fix: Change the "in" operator to hasOwnProperty #910

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

ssi02014
Copy link
Contributor

@ssi02014 ssi02014 commented Feb 15, 2024

Summary

@cure53 👋
Related: #908

Why not use the hasOwnProperty function to overcome the problems with the in operator?
In practice, this won't change much of the behavior. However, I expect it would be more stable..!! 🙏

Reference

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in#inherited_properties
https://stackoverflow.com/questions/13632999/if-key-in-object-or-ifobject-hasownpropertykey

@cure53
Copy link
Owner

cure53 commented Feb 19, 2024

Looks good to me, thank you again 🙂

@cure53 cure53 merged commit c4d49f6 into cure53:main Feb 19, 2024
8 checks passed
@ssi02014 ssi02014 deleted the fix/purify branch February 19, 2024 11:48
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.

2 participants