Skip to content

Commit

Permalink
[[FIX]] Allow comma expression in MemberExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglinmike authored and rwaldron committed Feb 22, 2021
1 parent c2719eb commit f05c8d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/jshint.js
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,7 @@ var JSHINT = (function() {
warning("W014", state.tokens.curr, state.tokens.curr.id);
}

e = expression(context & ~prodParams.noin, 10);
e = expression(context & ~prodParams.noin, 0);

if (e && e.type === "(string)") {
if (!state.option.evil && (e.value === "eval" || e.value === "execScript")) {
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,9 @@ exports.comma = function (test) {
"}"
], { });

TestRun(test, "within MemberExpression")
.test("void [][0, 0];")

test.done();
};

Expand Down

0 comments on commit f05c8d1

Please sign in to comment.