fix bug when ||, && then yield, should has () wrap the code.

This commit is contained in:
jchbh 2015-05-29 01:49:42 -07:00
parent 014f873ec1
commit 426cebc0e1

View File

@ -1068,7 +1068,10 @@ function OutputStream(options) {
// the space is optional depending on "beautify"
output.space();
}
var isYield = (self.right.operator == "yield" || self.right.operator === "yield*");
isYield && output.print("(");
self.right.print(output);
isYield && output.print(")");
});
DEFPRINT(AST_Conditional, function(self, output){
self.condition.print(output);