Deep cloning objects defined by JSON.

gaz Heyes gazheyes at
Sun Jan 22 14:46:04 PST 2012

I was pondering about this on twitter, at first I thought using cycrllic
variables to resolve references to object within the JSON object but
actually we just need "this" to work within object literals and be allowed
in the specification. For example this works currently :
  return this.b;

But it would be nicer to resolve "this" inside a object literal property to
be itself rather than window or undefined:

This would make JSON much smaller and allow circular references without
losing data.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list