Comment #10 on issue 1547 by [email protected]: Wrong global in cross-frame this-coercion
http://code.google.com/p/v8/issues/detail?id=1547

ES5 wants oooouuuu.

I can agree with that. The inconsistency is actually having iooouuuu, which also makes the leak hazard moot.

*Calling* a function via a variable isn't really different from calling it through another expression (if you ignore "with" statements). Both simply pass undefined as the thisArg to [[Call]].

Resolving global variables actually doesn't produce a property reference, but a reference with an environment record (the global environment) as base (11.1.2 > 10.3.1 > (using Global Environment - 10.2.3) > 10.2.2.1 generates a reference with the global environment as base) and that means that thisArg is undefined when calling the function's [[Call]] method (11.2.3 step 6.b calls ImplicitThisValue (10.2.1.2.6) on the global environment, which returns undefined).

That too is why I think it's inconsistent to have foo()() and var x=foo();x() act differently, or even f() and (1,f)() , since they call [[Call]] with the same arguments.

The only behavior that the web actually depends on is that the first type of call should be "i". With that, leaks are a fact, and the I (personally) see no reason to prefer 'o' over 'i' for the remaining cases.



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to