- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Sun, 22 Dec 2013 03:03:17 -0500
- To: Garrett Smith <dhtmlkitchen@gmail.com>
- CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
On 12/22/13 2:40 AM, Garrett Smith wrote:
> So if the window.performance API was not `undefined` in, say a browser
> that supports none of the prior, then the VariableStatement `var
> performance` would then cause it to be, is that it? And that the
> initialiser would then potentially get to the bottom of that list and
> find window.performance, which now points to that var, and not another
> object.
If the "performance" property is somewhere up the proto chain that's
what would happen, yes.
>> var onload;
>> (function() {
>> onload = { foo: "bar"; };
>> doSomething(onload);
>> })();
>>
>> Some instances of this pattern have a "var onload" inside the function,
>> but some do not, and it's the latter that are problematic.
>>
> Because `onload` now holds the value `undefined`?
No, because the assignment above, if it actually sets the IDL "onload"
property, sets it to null.
> Of those that do not, what do they do?
They end up setting window.onload to null and then passing null to
doSomething.
> Is there any other way to make Identifier Resolution search first for
> variables added to the VariableEnvironment.
I'm not trying to make any changes to how ES identifier resolution works
here. I think we want to limit the extent of the craziness we have to
deal with, and hacking identifier resolution for this case is more than
I'm interested in doing. ;)
-Boris
Received on Sunday, 22 December 2013 08:03:57 UTC