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 Feb 29, 2024. It is now read-only.
Then the check that fixed issue 50 in r38 will fail since it would use the own property "hasOwnProperty" instead of the Object.prototype.hasOwnProperty function.
Fix by using Object.prototype.hasOwnProperty.call( foobar, key );
instead of foobar.hasOwnProperty( key ); which depends on the fact that the objet itself will never have a property by that name.
From timotijhof on September 25, 2011 18:19:11
Although it's a fairly rare edge case, suppose an object looks like this:
var FooBar = {
isAwesome: true,
getProp: function(){ },
hasOwnProperty: true
};
Then the check that fixed issue 50 in r38 will fail since it would use the own property "hasOwnProperty" instead of the Object.prototype.hasOwnProperty function.
Fix by using Object.prototype.hasOwnProperty.call( foobar, key );
instead of foobar.hasOwnProperty( key ); which depends on the fact that the objet itself will never have a property by that name.
Original issue: http://code.google.com/p/jquery-json/issues/detail?id=51
The text was updated successfully, but these errors were encountered: