All else being equal, your suggestion seems like the obviously right thing,
on at least consistency and least surprise grounds.

I know we discussed this. Anyone remember why we didn't do what Jason
suggests? My memory of counter-arguments here is blank.




On Mon, Mar 2, 2015 at 1:07 PM, Jason Orendorff <jason.orendo...@gmail.com>
wrote:

> Classes are specified to have an immutable inner binding even if they
> also declare a mutable lexical binding in the enclosing scope:
>
>     class Foo {
>         foo() {
>             // immutable inner binding 'Foo' is in scope here
>         }
>     }
>     // mutable lexical binding 'Foo' is in scope here
>
> Having two bindings can be tricky. Suppose I then do this:
>
>     Foo = wrapConstructorWithExtraLogging(Foo);
>
> Now the two bindings have different values. If one of Foo's methods
> does `new Foo`, we don't get the extra logging.
>
> Can we go back to having classes do what functions do? A single
> function never introduces two bindings; rather a named function
> expression has only the immutable inner binding and a function
> declaration only declares a variable.
>
> -j
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to