lexical 'super' in arrow functions?
allen at wirfs-brock.com
Mon Dec 3 16:07:19 PST 2012
On Dec 3, 2012, at 2:00 AM, Claus Reinke wrote:
>>>> 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.
> That would be good.
OK, I looked more closely and anything needed for super references within from within Arrow functions is already in the current draft. Just trace through the algorithms in section 11.2.4. Particularly, steps 1-4 of the Evaluation algorithms. However, I did add a few clarifying note in the next draft.
More information about the es-discuss