Skip to content

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