Fix yield expression transform (#9076)
This commit is contained in:
parent
61f2aed5b0
commit
2bb24f996f
@ -166,6 +166,7 @@ export function YieldExpression(node: Object, parent: Object): boolean {
|
|||||||
t.isCallExpression(parent) ||
|
t.isCallExpression(parent) ||
|
||||||
t.isMemberExpression(parent) ||
|
t.isMemberExpression(parent) ||
|
||||||
t.isNewExpression(parent) ||
|
t.isNewExpression(parent) ||
|
||||||
|
(t.isAwaitExpression(parent) && t.isYieldExpression(node)) ||
|
||||||
(t.isConditionalExpression(parent) && node === parent.test) ||
|
(t.isConditionalExpression(parent) && node === parent.test) ||
|
||||||
isClassExtendsClause(node, parent)
|
isClassExtendsClause(node, parent)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -10,3 +10,7 @@ function* asdf() {
|
|||||||
function* a(b) {
|
function* a(b) {
|
||||||
(yield xhr({ url: "views/test.html" })).data;
|
(yield xhr({ url: "views/test.html" })).data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(async function* () {
|
||||||
|
await (yield 1);
|
||||||
|
});
|
||||||
|
|||||||
@ -11,4 +11,8 @@ function* a(b) {
|
|||||||
(yield xhr({
|
(yield xhr({
|
||||||
url: "views/test.html"
|
url: "views/test.html"
|
||||||
})).data;
|
})).data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(async function* () {
|
||||||
|
await (yield 1);
|
||||||
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user