Skip to content

Commit

Permalink
add test for jshint#3455 case
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Francisco committed Mar 29, 2020
1 parent 2916d01 commit b7f6728
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/core.js
Expand Up @@ -2354,6 +2354,20 @@ exports.initializeCStyle = function(test) {
test.done();
};

// regression test for gh-3455
exports.constWithoutVar = function(test) {
TestRun(test)
.addError(1, 11, "Expected an identifier and instead saw ';'.")
.addError(1, 12, "Expected an identifier and instead saw ')'.")
.addError(1, 12, "Expected ';' and instead saw ''.")
.addError(1, 12, "Unrecoverable syntax error. (100% scanned).")
.test([
"for (const;)"
], { esversion: 6 });

test.done();
};

exports.constWithoutInit = function(test) {
TestRun(test, "single binding")
.addError(1, 6, "const 'x' is initialized to 'undefined'.")
Expand Down

0 comments on commit b7f6728

Please sign in to comment.