Permalink
Browse files

[javascript mode] Fix suble parsing bug in for loop specs

  • Loading branch information...
1 parent 831a3a5 commit 07e933a8aae72b2ca6e6d87e9133cb3f65a3a10c @marijnh marijnh committed Sep 28, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 mode/javascript/javascript.js
@@ -284,10 +284,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == ",") return cont(vardef1);
}
function forspec1(type) {
- if (type == "var") return cont(vardef1, forspec2);
- if (type == ";") return pass(forspec2);
+ if (type == "var") return cont(vardef1, expect(";"), forspec2);
+ if (type == ";") return cont(forspec2);
if (type == "variable") return cont(formaybein);
- return pass(forspec2);
+ return cont(forspec2);
}
function formaybein(type, value) {
if (value == "in") return cont(expression);

0 comments on commit 07e933a

Please sign in to comment.