forked from jshint/jshint
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for issue jshint#565. Makes blocks a special case of statements. …
…This fix also prevents jshint from crashing due to unmatched curly-brackets in many cases (such as 'expected {, was (end)' in tests/unit/fixtures/comma.js)
- Loading branch information
CarlEkerot
committed
Aug 1, 2012
1 parent
e07b48a
commit e608f03
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var a, b, c; | ||
a = 1; | ||
{ | ||
b = 2; | ||
{ | ||
c = 7; | ||
} | ||
set_to_three: { | ||
a = 3; | ||
} | ||
count: | ||
for (var i = 1; i <= 3; ++i) { | ||
a += i; | ||
} | ||
switchStmt: | ||
switch (a) { | ||
case 0: b = 1; break; | ||
case 1: b = 0; break; | ||
default: b = 2; break; | ||
} | ||
} | ||
c = 3; | ||
|
||
labeledBlock: { | ||
c += a + b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters