Wrap ForStatement in a block for const decls (#172)

This commit is contained in:
James Long authored and GitHub committed 2017-01-13 14:57:46 -05:00
1 parent b429b2443c
commit 6be89286bb
1 file changed
+2 -1
+2 -1
View File
@@ -867,7 +867,7 @@ function genericPrintNoParens(path, options, print) {
}
return group(concat(parts));
case "ForStatement":
case "ForStatement": {
const body = adjustClause(path.call(print, "body"), options);
if (!n.init && !n.test && !n.update) {
@@ -900,6 +900,7 @@ function genericPrintNoParens(path, options, print) {
")",
body,
]);
}
case "WhileStatement":
return concat([
"while (",