Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
javascript: Properly handle nested unknown blocks
Properly match open curly braces when parsing a statement not to possibly get fooled by unexpected nested blocks, e.g. after a `switch`'s `case` or a label. This mostly reverts c54c3ad and replaces it with a more correct and complete solution.
- Loading branch information
Showing
4 changed files
with
40 additions
and
29 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
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,23 @@ | ||
|
||
var o = { | ||
aa: function () { | ||
foo: { | ||
return ; | ||
} | ||
}, | ||
|
||
bb: function (a) { | ||
switch (a) { | ||
case 1: | ||
if (1) { | ||
return 32 | ||
} | ||
break; | ||
case 2: | ||
return 31; | ||
} | ||
return 1; | ||
}, | ||
|
||
cc: function() {} | ||
}; |
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,5 @@ | ||
# format=tagmanager | ||
aa�128�o�0 | ||
bb�128�o�0 | ||
cc�128�o�0 | ||
o�1�0 |