Finding a "safety syntax" for classes

Russell Leggett russell.leggett at gmail.com
Fri Mar 23 11:33:01 PDT 2012


On Fri, Mar 23, 2012 at 2:06 PM, Brendan Eich <brendan at mozilla.org> wrote:

> Brendan Eich wrote:
>
>> We need to overcome at least one TC39er who values
>>
> "requiring an error for"
>
>  use-before-init for instance properties, perhaps only if const or
>> guarded, so (I hope) we can defer those without being hostile to them in
>> the future.
>>
> Hope it was clear the first time...


I'll admit I was a little confused. Makes sense now. To be clear, you would
be referring to:

    let foo = new Foo();
    foo.fail(); //this should be an error

    class Foo {
        fail(){
            alert("This alert won't happen.");
        }

        success(){
            alert("This should be fine");
        }
    }

    let foo2 = new Foo();
    foo2.success(); //would work fine

and by error you mean before the code is actually evaluated?

- Russ



>
>
> /be
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120323/f0c9bf2b/attachment.html>


More information about the es-discuss mailing list