Avoid syntax error in yield assignments (fixes #1054)
This commit is contained in:
@@ -1234,9 +1234,7 @@ function OutputStream(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isYield = (self.right.operator == "yield" || self.right.operator === "yield*");
|
isYield = (self.right.operator == "yield" || self.right.operator === "yield*");
|
||||||
isYield && output.print("(");
|
|
||||||
output.print(op);
|
output.print(op);
|
||||||
isYield && output.print(")");
|
|
||||||
|
|
||||||
if ((op == "<" || op == "<<")
|
if ((op == "<" || op == "<<")
|
||||||
&& self.right instanceof AST_UnaryPrefix
|
&& self.right instanceof AST_UnaryPrefix
|
||||||
|
|||||||
@@ -434,3 +434,13 @@ generators_yield: {
|
|||||||
}
|
}
|
||||||
expect_exact: "function*fn(){yield remote()}"
|
expect_exact: "function*fn(){yield remote()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generators_yield_assign: {
|
||||||
|
input: {
|
||||||
|
function* fn() {
|
||||||
|
var x = {};
|
||||||
|
x.prop = yield 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect_exact: "function*fn(){var x={};x.prop=yield 5}"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user