You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.
Otherwise strange things happen if the application adds properties to the Array prototype, another solution is to insert an "hasOwnProperty" check inside the "for in" loop, but the former is a better fix for arrays imho.
For example, in the loop function, starting from row 342:
- Removed JSON.stringify (issue melanke#37)
- Added level parameter (issue melanke#30)
- Replaced 'for in' with standard for when iterating over arrays, added the hasOwnProperty check otherwise (issue melanke#45)
- Added support for checking arrays in the getObjDiff function
- Removed usage of addNRemove when level is 0
Otherwise strange things happen if the application adds properties to the Array prototype, another solution is to insert an "hasOwnProperty" check inside the "for in" loop, but the former is a better fix for arrays imho.
For example, in the loop function, starting from row 342:
In this case, the loop will iterate also over non owned-properties, i.e. property added to the Array prototype.
So the code should be changed to:
Same apply when iterating over objects, but in this case an "obj.hasOwnProperty(prop)" check inside the "for in" loop is required.
The text was updated successfully, but these errors were encountered: