lexical 'super' in arrow functions?
allen at wirfs-brock.com
Sun Dec 2 22:14:04 PST 2012
On Dec 2, 2012, at 12:13 PM, Claus Reinke wrote:
> First attempt got lost or stuck somewhere, trying again.
> From: "Claus Reinke" <claus.reinke at talk21.com>
> Sent: Thursday, November 29, 2012 10:02 PM
> To: <es-discuss at mozilla.org>
> Subject: lexical 'super' in arrow functions?
>> Is 'super' currently limited to method bodies, excluding local functions?
>> Given that 'this' is lexical in arrow functions, I expected any enclosing
>> 'super' to be available, as well, but I cannot confirm this from the spec.
Yes, clearly super should be able to be used in an arrow function that is lexically scoped to an enclosing super binding. The mechanism for describing this are mostly in the spec., but I just checked and there are a few loose ends that I will clean-up in the next spec. draft.
Whether anything besides a concise method in a class can have a super binding is something that still needs to be discuss. There are some uses, eg class-side methods that reference super that can not be expressed if super use is restricted to concise methods within class bodies.
>> This is from listening in on some of the TypeScript traffic, where people
>> are running into all kind of issues when trying to use ES6 classes, btw. Claus
Do you have a link to the threads? Sounds interesting...
> es-discuss mailing list
> es-discuss at mozilla.org
More information about the es-discuss