Skip to content

Commit

Permalink
Fix yield expression transform (#9076)
Browse files Browse the repository at this point in the history
  • Loading branch information
phapp88 authored and existentialism committed Nov 27, 2018
1 parent 61f2aed commit 2bb24f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/babel-generator/src/node/parentheses.js
Expand Up @@ -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)
);
Expand Down
Expand Up @@ -10,3 +10,7 @@ function* asdf() {
function* a(b) {
(yield xhr({ url: "views/test.html" })).data;
}

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

(async function* () {
await (yield 1);
});

0 comments on commit 2bb24f9

Please sign in to comment.