You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is that I found the ES6 spec prohibits a non-arrow function (unless it's a method function) from holding super. So modifying the inner function to arrow will solve the problem:
So I suggest that Regenerator give us an option to output it in arrow function. Because for this case, we even can't use the more simple "generator-to-async" transformer because it will produce:
The problem is when the async function is a class method (or is inside a class method) that holds
super
. For example:But the generated JS is illegal:
The reason is that I found the ES6 spec prohibits a non-arrow function (unless it's a method function) from holding
super
. So modifying the inner function to arrow will solve the problem:So I suggest that Regenerator give us an option to output it in arrow function. Because for this case, we even can't use the more simple "generator-to-async" transformer because it will produce:
which is also illegal. So a thing like Regenerator is a must, until the async function is natively supported, maybe in 2017.
BTW, I'm not quite sure if this is legal in ES7:
though I guess it's legal.
It can be better to also have an option to output
"use strict"
on top of the generated code, because the use case is not limited to 6-5, but also 7-6.The text was updated successfully, but these errors were encountered: