fix bug where async class methods weren't having their awaits converted to yields in the async to generator helper - fixes #2661
This commit is contained in:
@@ -46,8 +46,6 @@ function plainFunction(path: NodePath, callId: Object) {
|
||||
node.async = false;
|
||||
node.generator = true;
|
||||
|
||||
path.traverse(awaitVisitor);
|
||||
|
||||
let built = t.callExpression(callId, [node]);
|
||||
let container = buildWrapper({
|
||||
FUNCTION: built,
|
||||
@@ -93,6 +91,8 @@ export default function (path: NodePath, callId: Object) {
|
||||
let node = path.node;
|
||||
if (node.generator) return;
|
||||
|
||||
path.traverse(awaitVisitor);
|
||||
|
||||
if (path.isClassMethod()) {
|
||||
return classMethod(path, callId);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user