David Herman wrote:
>  For the first group (function, module), there is no problem. For the second 
(let, const, class, private -- although TBH, I forgot the reason why 'class' is in 
this group), we have temporal dead zone, where accessing a variable before its 
initialization is an error.

The class's `extends` clause has to be evaluated and can have arbitrary user 
code, side effects, etc.

Oops, forgot that! Good point.

  Similar for possible future clauses like computed property value expressions.
And static fields with initializers.

>  That seems clean, useful, consistent, and fairly easy to understand. 
Introducing extra rules for 'let'? Not so much.

But TDZ does introduce extra rules! Especially with disallowing assignment 
temporally before initialization.

Wait, Andreas was stipulating TDZ with its extra rules but noting they apply to non-function, non-module binding forms. So apples to apples, he is noting that if let lacks TDZ, then we have something extra.

You could counter-argue that this something extra is already in the pot due to var.

I'm still ok with TDZ, but apprehensive of performance fault myth and truth based on early implementations of it that are not sufficiently optimized (if only for gamed benchmarks).

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

Reply via email to