Lexical scoping of 'function' in sloppy mode breaks legal ES5

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Aug 20 12:29:53 PDT 2013

On Aug 20, 2013, at 11:53 AM, Brendan Eich wrote:

> Andreas Rossberg wrote:
>> I tend to agree that this particular detail should be considered a
>> spec bug.
> Yes, this is a spec bug. How did we miss it? Allen, do you have notes on the history?

I was looking at the change history and ES5-discuss archives earlier today and couldn't find anything definitive on this specific point.  This happen as part of the larger task of formalizing environment records, variable/function instantiations, and the correct lexical scoping of with statements and catch clauses.  I suspect we just missed identifying  this very special case as it is the only situation in non-extended ES where a FunctionDeclaration can actually be instantiated within an inner scope.

The good news is that the FF/Safari behavior is a better match to what we want for ES6 inner scope FunctionDeclarations.


More information about the es-discuss mailing list