Skip to content

Commit

Permalink
throw parse error on invalid assignments (#1627)
Browse files Browse the repository at this point in the history
fixes #1626
  • Loading branch information
alexlamsl authored Mar 21, 2017
1 parent 30a7504 commit 4bceb85
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
4 changes: 1 addition & 3 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1501,9 +1501,7 @@ function parse($TEXT, options) {
};

function is_assignable(expr) {
if (!options.strict) return true;
if (expr instanceof AST_This) return false;
return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol);
return expr instanceof AST_PropAccess || expr instanceof AST_SymbolRef;
};

var maybe_assign = function(no_in) {
Expand Down
16 changes: 0 additions & 16 deletions test/compress/html_comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,6 @@ html_comment_in_greater_than_or_equal: {
expect_exact: "function f(a,b){return a-- >=b}";
}

html_comment_in_right_shift_assign: {
input: {
// Note: illegal javascript
function f(a, b) { return a-- >>= b; }
}
expect_exact: "function f(a,b){return a-- >>=b}";
}

html_comment_in_zero_fill_right_shift_assign: {
input: {
// Note: illegal javascript
function f(a, b) { return a-- >>>= b; }
}
expect_exact: "function f(a,b){return a-- >>>=b}";
}

html_comment_in_string_literal: {
input: {
function f() { return "<!--HTML-->comment in<!--string literal-->"; }
Expand Down

0 comments on commit 4bceb85

Please sign in to comment.