diff --git a/packages/babel-helper-remap-async-to-generator/src/index.js b/packages/babel-helper-remap-async-to-generator/src/index.js index 8a08e58ec4..a8ba68f0be 100644 --- a/packages/babel-helper-remap-async-to-generator/src/index.js +++ b/packages/babel-helper-remap-async-to-generator/src/index.js @@ -62,6 +62,8 @@ function plainFunction(path: NodePath, callId: Object) { let retFunction = container.body.body[1].argument; if (path.isFunctionDeclaration()) { + node.type = "FunctionExpression"; + let declar = t.variableDeclaration("let", [ t.variableDeclarator( t.identifier(asyncFnId.name),