throw parse error on invalid assignments (#1627)

fixes #1626
This commit is contained in:
Alex Lam S.L
2017-03-21 14:11:32 +08:00
committed by GitHub
parent 30a75049f5
commit 4bceb85cbf
2 changed files with 1 additions and 19 deletions

View File

@@ -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) {