On 5 March 2012 12:16, 程劭非 <[email protected]> wrote:
> {
> "a":123,
> "b": this.a
> }
>
> If you simply want “this” in JSON.parse, it will not be hard to implement
> it in my library.
> But I guess the problem is we have no way to refer to its parent. Do you
> have any ideas?
>
You could have something like this:
{
"a":123,
"b": function circular() { return this.a; }
}
and then obj.b(); would result in 123
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss