fix issue #371
simply adopted solution described by johnjbarton in issue #371
diff --git a/escodegen.js b/escodegen.js
index 9208803..54e7cfa 100644
--- a/escodegen.js
+++ b/escodegen.js
@@ -967,7 +967,7 @@
result = join(result, operator);
result = [join(
result,
- that.generateExpression(stmt.right, Precedence.Sequence, E_TTT)
+ that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)
), ')'];
});
result.push(this.maybeBlock(stmt.body, flags));
diff --git a/test/compare-harmony/for-of-statement.expected.js b/test/compare-harmony/for-of-statement.expected.js
index 5101c94..b3bda09 100644
--- a/test/compare-harmony/for-of-statement.expected.js
+++ b/test/compare-harmony/for-of-statement.expected.js
@@ -3,4 +3,6 @@
}
for (let i of array) {
}
+ for (let c of ('x', String('cat'))) {
+ }
}
diff --git a/test/compare-harmony/for-of-statement.expected.min.js b/test/compare-harmony/for-of-statement.expected.min.js
index d831c22..bf91f9c 100644
--- a/test/compare-harmony/for-of-statement.expected.min.js
+++ b/test/compare-harmony/for-of-statement.expected.min.js
@@ -1 +1 @@
-function test(){for(var i of array){}for(let i of array){}}
+function test(){for(var i of array){}for(let i of array){}for(let c of('x',String('cat'))){}}
diff --git a/test/compare-harmony/for-of-statement.js b/test/compare-harmony/for-of-statement.js
index 10a0e58..0a13ec2 100644
--- a/test/compare-harmony/for-of-statement.js
+++ b/test/compare-harmony/for-of-statement.js
@@ -4,4 +4,7 @@
for (let i of array) {
}
+
+ for (let c of ('x', String('cat'))) {
+ }
}