Convert arrow functions when remaping to generator. Fixes #2789

This commit is contained in:
Amjad Masad 2015-11-03 14:58:31 -08:00
parent 9eee677321
commit e33ad7d2fb
3 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1 @@
(async () => { await foo(); })()

View File

@ -0,0 +1,4 @@
import { coroutine as _coroutine } from "bluebird";
_coroutine(function* () {
yield foo();
})();

View File

@ -43,6 +43,10 @@ function classMethod(path: NodePath, callId: Object) {
function plainFunction(path: NodePath, callId: Object) {
let node = path.node;
if (path.isArrowFunctionExpression()) {
path.arrowFunctionToShadowed();
}
node.async = false;
node.generator = true;