Merge pull request #2793 from amasad/fix-2789

Convert arrow functions when remaping to generator. Fixes #2789
This commit is contained in:
Sebastian McKenzie 2015-11-04 19:18:50 +00:00
commit 5aa1b29ef8
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;