Skip to content

Commit

Permalink
adding destructuring assignment without a prefix token for jshint#883
Browse files Browse the repository at this point in the history
  • Loading branch information
guyzmo authored and jugglinmike committed Oct 21, 2014
1 parent 04fbda1 commit 534b680
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/stable/jshint.js
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,20 @@ var JSHINT = (function () {
error("E013", left, left.value);
}

if (left.id === "." || left.id === "[") {
if (left.id === ".") {
if (!left.left || left.left.value === "arguments") {
warning("E031", that);
}
that.right = expression(19);
return that;
} else if (left.id === "[") {
state.tokens.curr.left.first.forEach(function (t) {
if (funct[t.value] === "const") {
error("E013", t, t.value);
}
});
that.right = expression(19);
return that;
} else if (left.identifier && !isReserved(left)) {
if (funct[left.value] === "exception") {
warning("W022", left);
Expand Down

0 comments on commit 534b680

Please sign in to comment.