Merge pull request #2793 from amasad/fix-2789
Convert arrow functions when remaping to generator. Fixes #2789
This commit is contained in:
commit
5aa1b29ef8
@ -0,0 +1 @@
|
||||
(async () => { await foo(); })()
|
||||
@ -0,0 +1,4 @@
|
||||
import { coroutine as _coroutine } from "bluebird";
|
||||
_coroutine(function* () {
|
||||
yield foo();
|
||||
})();
|
||||
@ -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;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user