Fix missing semi-colon in for loop and var body (#388)

We avoid adding a `;` for a variable declaration in for loop but this is only meant if the var declaration is inside of the `()` part of the for loop. Not if the body part.

Fixes #385
This commit is contained in:
Christopher Chedeau authored and GitHub committed 2017-01-22 12:34:14 -08:00
1 parent 1a9e5e9022
commit 58a97ab597
3 files changed
+19 -9

No files matched your search

@@ -291,3 +291,12 @@ for (var i = 0; i < 10; ++i) {
}
"
`;
exports[`test var.js 1`] = `
"for (a in b) var c = {}; [];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (a in b)
var c = {};
[];
"
`;
+1
View File
@@ -0,0 +1 @@
for (a in b) var c = {}; [];