Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Inherited properties should be left out #50

Closed
Krinkle opened this issue May 23, 2014 · 3 comments
Closed

Inherited properties should be left out #50

Krinkle opened this issue May 23, 2014 · 3 comments

Comments

@Krinkle
Copy link
Owner

Krinkle commented May 23, 2014

From krinklemail on September 18, 2011 04:52:37

If the object has an extended prototype object (which I think is a bad thing, but some people do it), there are values being put into the JSON string that shouldn't be included.

In some situations it's an option to not support these conditions, however in the case of this plugin we should replicate that browsers behavior.

Code to reproduce:
Object.prototype.foo = 'bar';
var obj = { test: 12 };
JSON.stringify( obj );

[String] {"test":12}
$.toJSON( obj );
[String] {"test":12,"foo":"bar"}

Original issue: http://code.google.com/p/jquery-json/issues/detail?id=50

@Krinkle
Copy link
Owner Author

Krinkle commented May 23, 2014

From krinklemail on September 18, 2011 13:06:42

Added unit test in r37 . Fixed bug in r38 .

Status: Fixed

@Krinkle
Copy link
Owner Author

Krinkle commented May 23, 2014

From krinklemail on June 13, 2012 10:02:32

Summary: Inherited properties sohuld be left out

@Krinkle
Copy link
Owner Author

Krinkle commented May 23, 2014

From krinklemail on June 13, 2012 10:02:43

Summary: Inherited properties should be left out

@Krinkle Krinkle closed this as completed May 23, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant