Juan Ignacio Dopazo (2013-12-09T17:46:31.000Z)
On Mon, Dec 9, 2013 at 2:36 PM, Till Schneidereit <till at tillschneidereit.net> wrote:

You could also check the output of Traceur and TypeScript. I don't know how close either of them are to implementing the exact semantics of ES6 classes, but I'm sure it'll be helpful in any case.
>
>
>

Yup. See http://www.typescriptlang.org/Playground/#src=class%20Person%20%7B%0A%09private%20name%3A%20string%3B%0A%09%0A%09constructor(name)%20%7B%0A%09%09this.name%20%3D%20name%3B%0A%09%7D%0A%09%0A%09say(message%3A%20string)%20%7B%0A%09%09return%20this.name%20%2B%20'%20says%3A%20'%20%2B%20message%3B%0A%09%7D%0A%7D%0A%0Aclass%20Pirate%20extends%20Person%20%7B%0A%09constructor(name)%20%7B%0A%09%09super('Captn%5C'%20'%20%2B%20name)%3B%0A%09%7D%0A%09%0A%09say(message)%20%7B%0A%09%09return%20super.say(message%20%2B%20'%20Arrr!')%3B%0A%09%7D%0A%7D

 - Juan



On Monday, December 9, 2013 2:37 PM, Till Schneidereit <till at tillschneidereit.net> wrote:
 
You could also check the output of Traceur and TypeScript. I don't know how close either of them are to implementing the exact semantics of ES6 classes, but I'm sure it'll be helpful in any case.




On Mon, Dec 9, 2013 at 6:28 PM, James Long <longster at gmail.com> wrote:

I read Allen's email wrong, thought it implied `this` was lexically
>scoped (which I know is not true. very little sleep at an airport...).
>
>I'll keep digging through the spec, but if someone has a quick example
>what ES5 code I could compile to for roughly the same semantics, that
>would be helpful. From what I understand, you're saying that `super`
>is lexically scoped to the `class` that is defined so I can statically
>compile it out to something like `Foo.prototype.method` if `Foo` is
>the parent class. Anyway, no need to trail on about this, I should
>just RTFS.
>
>- James
>
>
>On Mon, Dec 9, 2013 at 11:23 AM, Brendan Eich <brendan at mozilla.com> wrote:
>> OnMon, Dec 9, 2013  at 10:22 AM,  Allen Wirfs-Brock
>>
>> <allen at wirfs-brock.com>  wrote:
>>
>>> >  super is lexically scoped
>>
>>
>> This is true.
>>
>>
>>
>> James Long wrote:
>>>
>>> So essentially super is an alias for `Object.getPrototypeOf(this)` ?
>>
>>
>> But |this| is not lexically scoped, so your question's answer must be "no".
>>
>> /be
>_______________________________________________
>es-discuss mailing list
>es-discuss at mozilla.org
>https://mail.mozilla.org/listinfo/es-discuss
>


_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131209/c76aa22d/attachment.html>
domenic at domenicdenicola.com (2013-12-10T02:30:55.549Z)
On Mon, Dec 9, 2013 at 2:36 PM, Till Schneidereit <till at tillschneidereit.net> wrote:

> You could also check the output of Traceur and TypeScript. I don't know how close either of them are to implementing the exact semantics of ES6 classes, but I'm sure it'll be helpful in any case.

Yup. See http://www.typescriptlang.org/Playground/#src=class%20Person%20%7B%0A%09private%20name%3A%20string%3B%0A%09%0A%09constructor(name)%20%7B%0A%09%09this.name%20%3D%20name%3B%0A%09%7D%0A%09%0A%09say(message%3A%20string)%20%7B%0A%09%09return%20this.name%20%2B%20'%20says%3A%20'%20%2B%20message%3B%0A%09%7D%0A%7D%0A%0Aclass%20Pirate%20extends%20Person%20%7B%0A%09constructor(name)%20%7B%0A%09%09super('Captn%5C'%20'%20%2B%20name)%3B%0A%09%7D%0A%09%0A%09say(message)%20%7B%0A%09%09return%20super.say(message%20%2B%20'%20Arrr!')%3B%0A%09%7D%0A%7D