[Bug 422751] Incorrect 'missing semicolon' warning in case of for-in loop
diff --git a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/semi.js b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/semi.js
index 767a349..99d6b28 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/semi.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/semi.js
@@ -38,9 +38,12 @@
 
 		function checkVariableDeclaration(node) {
 			var ancestors = context.getAncestors(node),
-			    parent = ancestors[ancestors.length - 1];
-			if (parent.type === "ForStatement" && parent.init === node) {
-				// for(var x;;) {} -- no semicolon token is required after the VariableDeclaration
+			    parent = ancestors[ancestors.length - 1],
+			    parentType = parent.type;
+			if ((parentType === "ForStatement" && parent.init === node) || (parentType === "ForInStatement" && parent.left === node)){
+			    // One of these cases, no semicolon token is required after the VariableDeclaration:
+				// for(var x;;)
+				// for(var x in y)
 				return;
 			}
 			checkForSemicolon(node);
diff --git a/bundles/org.eclipse.orion.client.javascript/web/eslint/tests/lib/rules/semi.js b/bundles/org.eclipse.orion.client.javascript/web/eslint/tests/lib/rules/semi.js
index 1116916..99bf2bc 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/eslint/tests/lib/rules/semi.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/eslint/tests/lib/rules/semi.js
@@ -115,7 +115,7 @@
 		assert.equal(messages.length, 0);
 	});
 	it("should not flag 1-liner function call", function() {
-		var topic = "foo(function() { x = 1; });"
+		var topic = "foo(function() { x = 1; });";
 
 		var config = { rules: {} };
 		config.rules[RULE_ID] = 1;
@@ -132,4 +132,22 @@
 		var messages = eslint.verify(topic, config);
 		assert.equal(messages.length, 0);
 	});
+	it("should not flag 'for in' with VariableDeclaration", function() {
+		var topic = "for (var x in ({}));";
+
+		var config = { rules: {} };
+		config.rules[RULE_ID] = 1;
+
+		var messages = eslint.verify(topic, config);
+		assert.equal(messages.length, 0);
+	});
+	it("should not flag 'for in'", function() {
+		var topic = "for (x in ({}));";
+
+		var config = { rules: {} };
+		config.rules[RULE_ID] = 1;
+
+		var messages = eslint.verify(topic, config);
+		assert.equal(messages.length, 0);
+	});
 });