Proxies and proto; cyclic now possible

Boris Zbarsky bzbarsky at mit.edu
Mon Dec 8 18:08:18 PST 2014


On 12/8/14, 6:24 PM, François REMY wrote:
> ± >     var o = {};
> ± >     var p = new Proxy(o, { get: function(o, p) { return o[p]; } });
> ± >     o.__proto__ = p;
> ±
> ± This does nothing on its own in Firefox, afaict.
> ± If I then do "o.foo" I get a "too much recursion" exception, as expected.
> ±
> ± What is the problem, exactly?
>
> I typed the line one by one in the console, that's why. There must be something wrong with the console, then.

The console may be trying to show the resulting object, yes.

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1108895 to track this.

> Great, that's what I was thinking about. I shared the same concern as Allen about involuntary while loop of prototype cascade that would never return to the user code and would never stop at all. But if UA are aware of the situation and took action, that should be fine I agree. I just wanted to be sure it's the case. It seems Firefox's console didn't get the message but Firefox itself seems to handle this fine.

Not quite, see bug report.

-Boris


More information about the es-discuss mailing list