Fix yield expression transform (#9076)

This commit is contained in:
Paul Happ 2018-11-27 09:45:06 -06:00 committed by Brian Ng
parent 61f2aed5b0
commit 2bb24f996f
3 changed files with 10 additions and 1 deletions

View File

@ -166,6 +166,7 @@ export function YieldExpression(node: Object, parent: Object): boolean {
t.isCallExpression(parent) ||
t.isMemberExpression(parent) ||
t.isNewExpression(parent) ||
(t.isAwaitExpression(parent) && t.isYieldExpression(node)) ||
(t.isConditionalExpression(parent) && node === parent.test) ||
isClassExtendsClause(node, parent)
);

View File

@ -10,3 +10,7 @@ function* asdf() {
function* a(b) {
(yield xhr({ url: "views/test.html" })).data;
}
(async function* () {
await (yield 1);
});

View File

@ -11,4 +11,8 @@ function* a(b) {
(yield xhr({
url: "views/test.html"
})).data;
}
}
(async function* () {
await (yield 1);
});