On Sep 11, 2012, at 4:39, "Brendan Eich" <[email protected]> wrote:

> Brendan Eich wrote:
>> Dmitry Soshnikov wrote:
>>> var FOO = 42;
>>> function bar(x, y = FOO + z) { var z = 10; } // Error .. ?
>> 
>> Translating to JS as it is:
>> 
>>  var FOO = 42;
>>  function bar(x, y) {
>>    if (y === void 0) y = FOO + z;
>>    var z = 10;
>>  } 
> 
> Another benefit of the simple semantics: existing JITs can optimize easily, 
> no new semantics to special-case. This is not a dominant concern but it is a 
> selling point from my experience dealing with (and playing one on TV ;-)) 
> implementors.
> 
> /be

And, if one replaced all `var`s in the above example with `let`s, one would get 
the desired error, right? To me the most important use cases to consider are 
those in an "idiomatic ES6" let-is-the-new-var world.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to