An experiment using an object literal based class definitionpattern

Brendan Eich brendan at
Tue Aug 9 13:20:20 PDT 2011

On Aug 9, 2011, at 1:18 AM, Claus Reinke wrote:

>> The name resolution rules we agreed to permit mutually recursive
>> functions without hoisting (or you could view those rules as hoisting
>> everything):
>> let f1 = function() {f2()};
>> let f2 = function() {f1()};
>> f1();  //happily recurs until it it runs out of stack
> Sorry, I seem to have missed that discussion - are those new rules
> documented somewhere? I had some concerns about the old rules,
> and would like to check whether those are resolved.

See my day 2 notes:

or here, with better formatting:

> Indeed, that is the main flaw in the idea of using hoisting as a substitute
> for letrec: mixing declarative and imperative forms. I've been tempted to
> suggest that function declarations are hoisted only within their group of
> declarations.

We are not breaking compatibility on this point in an opt-in future edition. It would just break incorrectly-migrated code at runtime.


More information about the es-discuss mailing list