nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: jshint/jshint
Pull request #3169 (2017-08-12 18:58:40)

[[FIX]] Do not create binding for illegal syntax
When a function declaration without an identifier is encountered, JSHint
issues a warning and attempts to continue parsing the declaration.

Previously, JSHint created a new binding for the "function" keyword, and
because such a binding can never be referenced, this would generate
spurious warnings when the "unused" option was enabled.

Do not create a faulty binding in the presence of this syntax error.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/12809888/badge)](https://coveralls.io/builds/12809888)

Coverage remained the same at 97.764% when pulling **375a5106600a8a1a8048c27fe44601044c2fb4a4 on jugglinmike:unused-func** into **a5ff715c58cfc8cda4f8ab5ffbf4f0146b4328e8 on jshint:master**.


Patch:
diff --git a/src/jshint.js b/src/jshint.js
index 52a9f640..613303c3 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -3909,14 +3909,16 @@ var JSHINT = (function() {
     }
     var i = optionalidentifier();
 
-    state.funct["(scope)"].addlabel(i, {
-      type: "function",
-      token: state.tokens.curr });
-
     if (i === undefined) {
       warning("W025");
-    } else if (inexport) {
-      state.funct["(scope)"].setExported(i, state.tokens.prev);
+    } else {
+      state.funct["(scope)"].addlabel(i, {
+        type: "function",
+        token: state.tokens.curr });
+
+      if (inexport) {
+        state.funct["(scope)"].setExported(i, state.tokens.prev);
+      }
     }
 
     doFunction({


Test patch:
diff --git a/tests/unit/core.js b/tests/unit/core.js
index 4df6729a..bad89d6d 100644
--- a/tests/unit/core.js
+++ b/tests/unit/core.js
@@ -1668,6 +1668,10 @@ exports.testUnnamedFuncStatement = function (test) {
     .addError(1, "Missing name in function declaration.")
     .test("function() {}");
 
+  TestRun(test, "with 'unused' option")
+    .addError(1, "Missing name in function declaration.")
+    .test("function() {}", { unused: true });
+
   test.done();
 };
Repository: jshint/jshint
Pull request #3217 (2017-11-27 00:43:01)

[[FIX]] Tolerate RegExp as `void` operand
Hey @rwaldron. I imagine that a patch like this would cause you to wonder about my priorities. Rest assured: I'm focused on async functions these days. I just stumbled on this corner case while trying to parse `await` correctly.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/14373020/badge)](https://coveralls.io/builds/14373020)

Coverage remained the same at 98.744% when pulling **fc40371028ffdc9248fc2f310401323fffafbcc6 on jugglinmike:void-regexp** into **d03662c84c9eb032ab2163489989cde45b8f8565 on jshint:master**.

rwaldron: LGTM

Patch:
diff --git a/src/lex.js b/src/lex.js
index ade8c102..b620420d 100644
--- a/src/lex.js
+++ b/src/lex.js
@@ -1703,7 +1703,7 @@ Lexer.prototype = {
 
       if (type === "(identifier)") {
         if (value === "return" || value === "case" || value === "yield" ||
-            value === "typeof" || value === "instanceof") {
+            value === "typeof" || value === "instanceof" || value === "void") {
           this.prereg = true;
         }
 


Test patch:
diff --git a/tests/unit/parser.js b/tests/unit/parser.js
index 55f602fb..b3158bf6 100644
--- a/tests/unit/parser.js
+++ b/tests/unit/parser.js
@@ -557,6 +557,7 @@ exports.regexp = function (test) {
     "var x = w - /s/;",
     "var y = typeof /[a-z]/;", // GH-657
     "var z = /a/ instanceof /a/.constructor;", // GH-2773
+    "void /./;",
     "var v = /dsdg;"
   ];
 
@@ -576,8 +577,8 @@ exports.regexp = function (test) {
     .addError(17, 9, "Invalid regular expression.")
     .addError(20, 9, "Invalid regular expression.")
     .addError(21, 9, "Invalid regular expression.")
-    .addError(28, 9, "Unclosed regular expression.")
-    .addError(28, 9, "Unrecoverable syntax error. (100% scanned).");
+    .addError(29, 9, "Unclosed regular expression.")
+    .addError(29, 9, "Unrecoverable syntax error. (100% scanned).");
 
   run.test(code, {es3: true});
   run.test(code, {}); // es5
Repository: jshint/jshint
Pull request #3357 (2019-02-07 02:46:36)

[[FIX]] Correct parsing of RegExp character sets
Do not interpret RegExp syntax characters using their specialized
semantics when they appear within a character set.

This is intended to resolve gh-3356

coveralls: 
[![Coverage Status](https://coveralls.io/builds/21499623/badge)](https://coveralls.io/builds/21499623)

Coverage increased (+0.001%) to 98.472% when pulling **76db9f8db902dbd74496e71eb6856370ffa910a5 on jugglinmike:regexp-char-class** into **0e85de5f33f3a4bb18833bbb87b4a08294f16899 on jshint:master**.


Patch:
diff --git a/src/lex.js b/src/lex.js
index 1ea296ae..1b1540c7 100644
--- a/src/lex.js
+++ b/src/lex.js
@@ -1582,6 +1582,11 @@ Lexer.prototype = {
         continue;
       }
 
+      if (isCharSet) {
+        index += 1;
+        continue;
+      }
+
       if (char === "{" && !hasInvalidQuantifier) {
         hasInvalidQuantifier = !checkQuantifier();
       }


Test patch:
diff --git a/tests/unit/parser.js b/tests/unit/parser.js
index c5e049b1..10efb3a2 100644
--- a/tests/unit/parser.js
+++ b/tests/unit/parser.js
@@ -866,6 +866,12 @@ exports.regexp.regressions = function (test) {
   TestRun(test).test("var exp = /\\[\\]/;", {esnext: true});
   TestRun(test).test("var exp = /\\[\\]/;", {moz: true});
 
+  // GH-3356
+  TestRun(test).test("void /[/]/;");
+  TestRun(test).test("void /[{]/u;", {esversion: 6});
+  TestRun(test).test("void /[(?=)*]/u;", {esversion: 6});
+  TestRun(test).test("void /[(?!)+]/u;", {esversion: 6});
+
   test.done();
 };
Repository: jshint/jshint
Pull request #3410 (2019-06-29 08:41:36)

[[FIX]] Do not crash on invalid program code
This should resolve gh-3408.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/24279143/badge)](https://coveralls.io/builds/24279143)

Coverage remained the same at 100.0% when pulling **5b78329f6ac2f440f2b64244fa150275717fc090 on jugglinmike:gh-3408** into **2366c92b852adeb963ecb812bc32b258288663dc on jshint:master**.


Patch:
diff --git a/src/jshint.js b/src/jshint.js
index baf95692..71f3d4bc 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -4372,11 +4372,13 @@ var JSHINT = (function() {
         }
         var id = state.tokens.prev;
         value = expression(context, 10);
-        if (value && value.identifier && value.value === "undefined") {
-          warning("W080", id, id.value);
-        }
-        if (!lone) {
-          destructuringPatternMatch(names, value);
+        if (value) {
+          if (value.identifier && value.value === "undefined") {
+            warning("W080", id, id.value);
+          }
+          if (!lone) {
+            destructuringPatternMatch(names, value);
+          }
         }
       }
 
@@ -4558,12 +4560,14 @@ var JSHINT = (function() {
         }
         id = state.tokens.prev;
         value = expression(context, 10);
-        if (value && !state.funct["(loopage)"] && value.identifier &&
-          value.value === "undefined") {
-          warning("W080", id, id.value);
-        }
-        if (!lone) {
-          destructuringPatternMatch(names, value);
+        if (value) {
+          if (!state.funct["(loopage)"] && value.identifier &&
+            value.value === "undefined") {
+            warning("W080", id, id.value);
+          }
+          if (!lone) {
+            destructuringPatternMatch(names, value);
+          }
         }
       }
 


Test patch:
diff --git a/tests/unit/parser.js b/tests/unit/parser.js
index b3fd37b4..9ce8690b 100644
--- a/tests/unit/parser.js
+++ b/tests/unit/parser.js
@@ -2493,6 +2493,25 @@ exports["destructuring assignment of valid simple assignment targets"] = functio
   test.done();
 };
 
+exports["regression test for GH-3408"] = function (test) {
+  TestRun(test, "var statement")
+    .addError(1, 9, "Expected an identifier and instead saw ';'.")
+    .addError(1, 10, "Missing semicolon.")
+    .test("var [x]=;", { esversion: 6 });
+
+  TestRun(test, "let statement")
+    .addError(1, 9, "Expected an identifier and instead saw ';'.")
+    .addError(1, 10, "Missing semicolon.")
+    .test("let [x]=;", { esversion: 6 });
+
+  TestRun(test, "const statement")
+    .addError(1, 11, "Expected an identifier and instead saw ';'.")
+    .addError(1, 12, "Missing semicolon.")
+    .test("const [x]=;", { esversion: 6 });
+
+  test.done();
+};
+
 exports["non-identifier PropertyNames in object destructuring"] = function (test) {
   var code = [
     "var { ['x' + 2]: a = 3, 0: b } = { x2: 1, 0: 2 };",
Repository: jshint/jshint
Pull request #3471 (2020-05-03 17:57:38)

[[FIX]] Improve tokenization of RegExp literals

coveralls: 
[![Coverage Status](https://coveralls.io/builds/30523109/badge)](https://coveralls.io/builds/30523109)

Coverage remained the same at 100.0% when pulling **70842927e9fc8adf4c78d8cecb226a5a1a2310d8 on jugglinmike:improve-regexp-tokenization** into **5e36b790bcafdcca9e9b01d80bc966fc2c1a0a85 on jshint:master**.


Patch:
diff --git a/src/jshint.js b/src/jshint.js
index 8e235b0b..54479591 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -1028,7 +1028,6 @@ var JSHINT = (function() {
   }
 
   function nolinebreak(t) {
-    t = t;
     if (!sameLine(t, state.tokens.next)) {
       warning("E022", t, t.value);
     }
diff --git a/src/lex.js b/src/lex.js
index 7626e252..c5431649 100644
--- a/src/lex.js
+++ b/src/lex.js
@@ -1987,7 +1987,8 @@ Lexer.prototype = {
       if (type === "(identifier)") {
         if (value === "return" || value === "case" || value === "yield" ||
             value === "typeof" || value === "instanceof" || value === "void" ||
-            value === "await") {
+            value === "await" || value === "new" || value === "delete" ||
+            value === "default" || value === "extends") {
           this.prereg = true;
         }
 


Test patch:
diff --git a/tests/test262/expectations.txt b/tests/test262/expectations.txt
index 468e0aab..183b9ba9 100644
--- a/tests/test262/expectations.txt
+++ b/tests/test262/expectations.txt
@@ -117,8 +117,6 @@ test/annexB/language/expressions/object/__proto__-duplicate.js(strict mode)
 test/annexB/language/statements/for-in/nonstrict-initializer.js(default)
 test/built-ins/Function/prototype/toString/unicode.js(default)
 test/built-ins/Function/prototype/toString/unicode.js(strict mode)
-test/built-ins/RegExp/S15.10.7_A2_T1.js(default)
-test/built-ins/RegExp/S15.10.7_A2_T1.js(strict mode)
 test/language/asi/S7.9.2_A1_T2.js(default)
 test/language/asi/S7.9_A1.js(default)
 test/language/asi/S7.9_A1.js(strict mode)
diff --git a/tests/unit/parser.js b/tests/unit/parser.js
index 8e99695b..3c37cdf1 100644
--- a/tests/unit/parser.js
+++ b/tests/unit/parser.js
@@ -761,6 +761,21 @@ exports.regexp.basic = function (test) {
       "void /\\09/;"
     ]);
 
+  TestRun(test, "following `new`")
+    .addError(1, 5, "Bad constructor.")
+    .addError(1, 5, "Missing '()' invoking a constructor.")
+    .test("new /./;");
+
+  TestRun(test, "following `delete`")
+    .addError(1, 11, "Variables should not be deleted.")
+    .test("delete /./;");
+
+  TestRun(test, "following `extends`")
+    .test("class R extends /./ {}", {esversion: 6});
+
+  TestRun(test, "following `default`")
+    .test("export default /./;", {esversion: 6, module: true});
+
   test.done();
 };
Repository: jshint/jshint
Pull request #3529 (2021-02-03 14:08:08)

[[Fix]] Don't warn when RegExp() is used without 'new'.
https://262.ecma-international.org/#sec-regexp-constructor
...
function call RegExp(…) is equivalent
to the object creation expression new RegExp(…)
with the same arguments
...

coveralls: 
[![Coverage Status](https://coveralls.io/builds/36831476/badge)](https://coveralls.io/builds/36831476)

Coverage remained the same at 100.0% when pulling **df7d2c167c3c47f3ecf284f90b3c972ffb81ab8c on lauriro:fix-regexp-warn** into **2d4a3d1601f96151023532ba1b1db5710c74d23e on jshint:master**.

jugglinmike: Thanks for the patch--this is a good idea!

It's a bit more refactoring than I'd typically like to see in a bug fix, but I'm not particularly fond of how the code is currently written, so I'll take it :)

Patch:
diff --git a/src/jshint.js b/src/jshint.js
index 08f8d8f0..d6a5f5a6 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -3046,14 +3046,17 @@ var JSHINT = (function() {
 
     if (left) {
       if (left.type === "(identifier)") {
-        if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) {
-          if ("Array Number String Boolean Date Object Error Symbol".indexOf(left.value) === -1) {
-            if (left.value === "Math") {
-              /* istanbul ignore next */
-              warning("W063", left);
-            } else if (state.option.newcap) {
-              warning("W064", left);
-            }
+        var newcapRe = /^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/;
+        var newcapIgnore = [
+          "Array", "Boolean", "Date", "Error", "Number",
+          "Object", "RegExp", "String", "Symbol"
+        ];
+        if (newcapRe.test(left.value) && newcapIgnore.indexOf(left.value) === -1) {
+          if (left.value === "Math") {
+            /* istanbul ignore next */
+            warning("W063", left);
+          } else if (state.option.newcap) {
+            warning("W064", left);
           }
         }
       }


Test patch:
diff --git a/tests/unit/fixtures/newcap.js b/tests/unit/fixtures/newcap.js
index 15b1ae9c..852ac068 100644
--- a/tests/unit/fixtures/newcap.js
+++ b/tests/unit/fixtures/newcap.js
@@ -19,8 +19,13 @@ bat = myAnimal();
 
 // Make sure we don't warn on Error, Number, etc.
 Array();
+Boolean();
+Date();
 Error();
 Number();
+/*jshint -W010 */
+Object();
+/*jshint +W010 */
+RegExp();
 String();
-Boolean();
 Symbol();
Repository: jshint/jshint
Pull request #3538 (2021-02-22 05:42:47)

[[FIX]] Enforce restrictions on `new` operand
These restrictions are imposed implicitly by precedence in the
ECMAScript grammar rather than any explicit "early error" rule.

---

I'm surprised that the Pratt parser doesn't enforce this kind of restriction automatically. Maybe I'm misunderstanding something though--I'm a bit rusty here. @rwaldron / @caitp: could I get a second opinion?

If this kind of explicit guard *is* necessary, then I suspect we're missing a lot of others.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/37314820/badge)](https://coveralls.io/builds/37314820)

Coverage remained the same at 100.0% when pulling **8f9b01473589f37592df47f4c4812f4496ad0c39 on jugglinmike:new-operand-restriction** into **c13c5cc2be9e5ac6ea1355b47d84e818d8ca135f on jshint:master**.


Patch:
diff --git a/src/jshint.js b/src/jshint.js
index c868ff8e..b64c7ff9 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -2364,11 +2364,14 @@ var JSHINT = (function() {
 
     return this;
   });
-  reserve("super", function() {
+
+  (function(superSymbol) {
+    superSymbol.rbp = 161;
+  })(reserve("super", function() {
     superNud.call(state.tokens.curr, this);
 
     return this;
-  });
+  }));
 
   assignop("=", "assign");
   assignop("+=", "assignadd");
@@ -2697,7 +2700,12 @@ var JSHINT = (function() {
     });
     if (mp) { return mp; }
 
+    var opening = state.tokens.next;
     var c = expression(context, 155), i;
+    if (!c.paren && c.rbp > 160) {
+      error("E024", opening, opening.value);
+    }
+
     if (c && c.id !== "function") {
       if (c.identifier) {
         switch (c.value) {
@@ -3268,7 +3276,7 @@ var JSHINT = (function() {
     return ret;
   });
 
-  application("=>");
+  application("=>").rbp = 161;
 
   infix("[", function(context, left, that) {
     var e, s, canUseDot;


Test patch:
diff --git a/tests/unit/core.js b/tests/unit/core.js
index a02be031..fe7e305c 100644
--- a/tests/unit/core.js
+++ b/tests/unit/core.js
@@ -249,6 +249,15 @@ exports.testNewNonNativeObject = function (test) {
   test.done();
 };
 
+exports.testNewArrowFn = function (test) {
+  TestRun(test)
+    .addError(1, 5, "Unexpected '('.")
+    .addError(1, 12, "Bad constructor.")
+    .addError(1, 12, "Missing '()' invoking a constructor.")
+    .test("new () => {};", {esversion: 6});
+
+  test.done();
+};
 
 /**
  * Test that JSHint allows `undefined` to be a function parameter.
diff --git a/tests/unit/parser.js b/tests/unit/parser.js
index 85ec6119..d9d774dc 100644
--- a/tests/unit/parser.js
+++ b/tests/unit/parser.js
@@ -7440,6 +7440,16 @@ exports.super.superCall = function (test) {
       "}"
     ], { esversion: 8 });
 
+  TestRun(test, "as operand to `new`")
+    .addError(3, 9, "Unexpected 'super'.")
+    .test([
+      "class C {",
+      "  constructor() {",
+      "    new super();",
+      "  }",
+      "}"
+    ], { esversion: 6 });
+
   test.done();
 };
Repository: jshint/jshint
Pull request #3552 (2021-07-11 00:23:13)

[[FIX]] Allow invoking result of optional chaining
This should resolve gh-3551.


Patch:
diff --git a/src/jshint.js b/src/jshint.js
index 3ffbee96..e60a65b0 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -3081,6 +3081,21 @@ var JSHINT = (function() {
     return that;
   }, 160, true);
 
+
+  /**
+   * Determine if a CallExpression's "base" is a type of expression commonly
+   * used in this position.
+   *
+   * @param {token} token - token describing the "base" of the CallExpression
+   * @returns {boolean}
+   */
+  function isTypicalCallExpression(token) {
+    return token.identifier || token.id === "." || token.id === "[" ||
+      token.id === "=>" || token.id === "(" || token.id === "&&" ||
+      token.id === "||" || token.id === "?" || token.id === "async" ||
+      token.id === "?." || (state.inES6() && token["(name)"]);
+  }
+
   infix("(", function(context, left, that) {
     if (state.option.immed && left && !left.immed && left.id === "function") {
       warning("W062");
@@ -3171,9 +3186,7 @@ var JSHINT = (function() {
           addEvalCode(left, p[0]);
         }
       }
-      if (!left.identifier && left.id !== "." && left.id !== "[" && left.id !== "=>" &&
-          left.id !== "(" && left.id !== "&&" && left.id !== "||" && left.id !== "?" &&
-          left.id !== "async" && !(state.inES6() && left["(name)"])) {
+      if (!isTypicalCallExpression(left)) {
         warning("W067", that);
       }
     }


Test patch:
diff --git a/tests/unit/parser.js b/tests/unit/parser.js
index 1c31fc56..c94e0f90 100644
--- a/tests/unit/parser.js
+++ b/tests/unit/parser.js
@@ -10590,5 +10590,11 @@ exports.optionalChaining = function (test) {
       { esversion: 11 }
     );
 
+  TestRun(test, "CallExpression")
+    .test(
+      "true?.false();",
+      { esversion: 11 }
+    );
+
   test.done();
 };
Repository: jshint/jshint
Pull request #3557 (2021-08-05 23:58:13)

[[FIX]] Allow optional chaining call as satement
Take care to only disable warning W030 for the "function call" form of
the optional chaining feature; the warning is still relevant for
property access.


Patch:
diff --git a/src/jshint.js b/src/jshint.js
index e60a65b0..f409c061 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -2717,11 +2717,16 @@ var JSHINT = (function() {
 
     var opening = state.tokens.next;
     var c = expression(context, 155), i;
+
+    if (!c) {
+      return this;
+    }
+
     if (!c.paren && c.rbp > 160) {
       error("E024", opening, opening.value);
     }
 
-    if (c && c.id !== "function") {
+    if (c.id !== "function") {
       if (c.identifier) {
         switch (c.value) {
         case "Number":
@@ -3070,6 +3075,7 @@ var JSHINT = (function() {
       that.left = left;
       advance();
       that.right = state.tokens.curr.led(context, left);
+      that.exps = true;
     } else {
       state.syntax["."].led.call(that, context, left);
     }


Test patch:
diff --git a/tests/unit/parser.js b/tests/unit/parser.js
index c94e0f90..96928580 100644
--- a/tests/unit/parser.js
+++ b/tests/unit/parser.js
@@ -10547,10 +10547,6 @@ exports.optionalChaining = function (test) {
     );
 
   TestRun(test, "arguments")
-    .addError(1, 10, "Expected an assignment or function call and instead saw an expression.")
-    .addError(2, 14, "Expected an assignment or function call and instead saw an expression.")
-    .addError(3, 20, "Expected an assignment or function call and instead saw an expression.")
-    .addError(4, 15, "Expected an assignment or function call and instead saw an expression.")
     .test([
         "true.x?.();",
         "true.x?.(true);",
@@ -10598,3 +10594,26 @@ exports.optionalChaining = function (test) {
 
   test.done();
 };
+
+// gh-3556: "Crash parsing: throw new"
+exports.loneNew = function (test) {
+  TestRun(test, "as reported")
+    .addError(4, 3, "Expected an identifier and instead saw '}'.")
+    .addError(4, 4, "Missing semicolon.")
+    .addError(1, 21, "Unmatched '{'.")
+    .addError(5, 1, "Unrecoverable syntax error. (100% scanned).")
+    .test([
+      "function code(data) {",
+      "  if (data.request === 'foo') {",
+      "    throw new ",
+      "  }",
+      "}"
+    ]);
+
+  TestRun(test, "simplified")
+    .addError(1, 4, "Expected an identifier and instead saw ';'.")
+    .addError(1, 5, "Missing semicolon.")
+    .test("new;");
+
+  test.done();
+};
Repository: jshint/jshint
Pull request #3558 (2021-08-06 00:34:46)

[[FIX]] Tolerate dangling NewExpression
This resolves gh-3556.


Patch:
diff --git a/src/jshint.js b/src/jshint.js
index e60a65b0..9f042104 100644
--- a/src/jshint.js
+++ b/src/jshint.js
@@ -2717,11 +2717,16 @@ var JSHINT = (function() {
 
     var opening = state.tokens.next;
     var c = expression(context, 155), i;
+
+    if (!c) {
+      return this;
+    }
+
     if (!c.paren && c.rbp > 160) {
       error("E024", opening, opening.value);
     }
 
-    if (c && c.id !== "function") {
+    if (c.id !== "function") {
       if (c.identifier) {
         switch (c.value) {
         case "Number":


Test patch:
diff --git a/tests/unit/parser.js b/tests/unit/parser.js
index c94e0f90..3ff0d8cd 100644
--- a/tests/unit/parser.js
+++ b/tests/unit/parser.js
@@ -10598,3 +10598,26 @@ exports.optionalChaining = function (test) {
 
   test.done();
 };
+
+// gh-3556: "Crash parsing: throw new"
+exports.loneNew = function (test) {
+  TestRun(test, "as reported")
+    .addError(4, 3, "Expected an identifier and instead saw '}'.")
+    .addError(4, 4, "Missing semicolon.")
+    .addError(1, 21, "Unmatched '{'.")
+    .addError(5, 1, "Unrecoverable syntax error. (100% scanned).")
+    .test([
+      "function code(data) {",
+      "  if (data.request === 'foo') {",
+      "    throw new ",
+      "  }",
+      "}"
+    ]);
+
+  TestRun(test, "simplified")
+    .addError(1, 4, "Expected an identifier and instead saw ';'.")
+    .addError(1, 5, "Missing semicolon.")
+    .test("new;");
+
+  test.done();
+};