On 3 September 2015 at 20:57, Brendan Eich <bren...@mozilla.org> wrote:

> Andreas Rossberg wrote:
>
>> On 3 September 2015 at 03:50, Brendan Eich <bren...@mozilla.org <mailto:
>> bren...@mozilla.org>> wrote:
>>
>>     I don't remember you overcoming the counterarguments about async
>>     scripts and event handlers in async-generated/written markup
>>     twisting the nested scopes unexpectedly.
>>
>>
>> The only cases where the scope order would make an observable difference
>> are ones that produce conflicts right now. So you'd only allow a few more
>> programs -- somewhat ill-behaved (non-deterministic) ones, but no more
>> ill-behaved than those that you can write with `var` today (or could with
>> `let` if it was a property on the global object! -- non-deterministic
>> shadowing  is still a less drastic effect than non-deterministic
>> overwriting).
>>
>
> The problem is the cognitive model and load. Nothing helps
> non-deterministic loading of scripts with global effects, but making every.
> last. script! nest a fresh lexical scope means "now you have two problems".
>

What I mean is that in a model with mutable scope (or worse, the global
object) _declarations_ themselves become global effects. Later conflicts
can affect all code that has been loaded _before_, e.g. by smashing over an
existing binding.

/Andreas
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to