Proposal: add an option to omit prototype of objects created by JSON.parse()

Tab Atkins Jr. jackalmage at gmail.com
Thu Oct 6 20:06:41 UTC 2016


On Thu, Oct 6, 2016 at 12:50 PM, Rick Waldron <waldron.rick at gmail.com> wrote:
> var o = JSON.parse('{}');
> Object.setPrototypeOf(o, null);

That's not remotely correct, as it does nothing for anything other
than the top object.  (And it breaks things if the top-level value
isn't an object.)

~TJ


More information about the es-discuss mailing list