- could we think of hoisting a class as hoisting its constructor

This would be a new kind of Temporal deal zone. I don't think we need it. Can you show a use case were the current proposal (class X{} scopes just like const X;) doesn't work.

Thinko of mine, sorry. The reasoning was that

   class X{ constructor(){} }
is short for
   function X(){}

and should be hoisted a such. But with the .prototype properties,
it would be more like

   class X{ constructor(){}; props }
is short for
   {props} <| function X(){}

which doesn't work (nor does hoisting the constructor without
the .prototype properties), while

   class X{ constructor(){}; props }
is short for
   const X = {props} <| function (){}

does make all-or-nothing sense.

Claus

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to