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

Skip prototype properties when looping over objects in objToPaths() #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DavidDurman
Copy link

objToPaths() is looping over objects not skipping the ones in the [[Prototype]] chain. Therefore, custom objects that have properties/methods in the prototype are being looped over as well. This creates an issue in the set() method where not only properties belonging to the custom objects are taken to get the shallow ('keyed with path names') object but also all the methods defined on its prototype.

Using hasOwnProperty() check is the recommended way to skip the ones defined in the prototype.

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