Permalink
Browse files

Added assertions to ensure that code execution procedes after lonely …

…blocks, and that start-bracket errors doesn't halt the parsing.
  • Loading branch information...
1 parent 2d65d8a commit f5ea56953d2fbc0425b086bde553808d581b6465 CarlEkerot committed Aug 2, 2012
Showing with 9 additions and 1 deletion.
  1. +5 −0 tests/unit/fixtures/blocks.js
  2. +4 −1 tests/unit/parser.js
View
5 tests/unit/fixtures/blocks.js
@@ -19,8 +19,13 @@ a = 1;
default: b = 2; break;
}
}
+
c = 3;
labeledBlock: {
c += a + b;
}
+
+badBlock: {
+ a = 0;
+ {
View
5 tests/unit/parser.js
@@ -373,7 +373,10 @@ exports.withStatement = function () {
exports.blocks = function () {
var src = fs.readFileSync(__dirname + "/fixtures/blocks.js", "utf8");
- TestRun().test(src);
+ TestRun()
+ .addError(29, 'Unmatched \'{\'.')
+ .addError(31, 'Unmatched \'{\'.')
+ .test(src);
};
exports.functionCharaterLocation = function () {

0 comments on commit f5ea569

Please sign in to comment.