Permalink
Browse files

Issue #1491: Parenthesis in odd-numbered token is ignored before arro…

…w function

Signed-off-by: Anton Kovalyov <anton@kovalyov.net>
  • Loading branch information...
1 parent 84aeeb9 commit fc75e3ea5bca23acf9ce8646ad40d9e12eeb8aa5 @arai-a arai-a committed with valueof Jan 27, 2014
Showing with 13 additions and 1 deletion.
  1. +0 −1 src/jshint.js
  2. +13 −0 tests/unit/parser.js
View
@@ -2585,7 +2585,6 @@ var JSHINT = (function () {
i += 1;
pn1 = peek(i);
- i += 1;
} while (!(parens === 0 && pn.value === ")") &&
pn1.value !== "=>" && pn1.value !== ";" && pn1.type !== "(end)");
View
@@ -4243,3 +4243,16 @@ exports["test destructuring function parameters as legacy JS"] = function (test)
test.done();
};
+
+exports["test for parentheses in odd-numbered token"] = function (test) {
+ var code = [
+ "let f, b;",
+ "let a = x => ({ f: f(x) });",
+ "b = x => x;"
+ ];
+
+ TestRun(test)
+ .test(code, {esnext: true});
+
+ test.done();
+};

0 comments on commit fc75e3e

Please sign in to comment.