Status: New
Owner: ----

New issue 3203 by [email protected]: JSON.stringify ignores data in the prototype
http://code.google.com/p/v8/issues/detail?id=3203

var a = {
  name: "Jack",
  eat: function() { return "nom, nom"; }
};

JSON.stringify(a); // returns '{ "name": "Jack" }'.
                   // This makes sense to me.

var b = Object.create(a);
JSON.stringify(b); // returns '{}'.
                   // This does not make sense to me!

--

Is this intentional? If so, why?

Surely an object's properties are the composition of its own properties and that of its prototypes. This is how "for in" views an object, which is why you have to explicitly call hasOwnProperty if you want to omit the prototype properties.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to