From 426cebc0e1aa4045aa25d30b944496d78d9f5059 Mon Sep 17 00:00:00 2001 From: jchbh Date: Fri, 29 May 2015 01:49:42 -0700 Subject: [PATCH] fix bug when ||, && then yield, should has () wrap the code. --- lib/output.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/output.js b/lib/output.js index cb743bd6..e539bc1b 100644 --- a/lib/output.js +++ b/lib/output.js @@ -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);