handle AST_Super in collapse_vars & side_effects

This commit is contained in:
alexlamsl
2017-09-17 05:00:58 +08:00
parent d73500e8d1
commit 3b0b4d6abf
2 changed files with 51 additions and 0 deletions

View File

@@ -579,6 +579,7 @@ merge(Compressor.prototype, {
}
function is_lhs_read_only(lhs) {
if (lhs instanceof AST_Super) return true;
if (lhs instanceof AST_This) return true;
if (lhs instanceof AST_SymbolRef) return lhs.definition().orig[0] instanceof AST_SymbolLambda;
if (lhs instanceof AST_PropAccess) {
@@ -2109,6 +2110,7 @@ merge(Compressor.prototype, {
def(AST_EmptyStatement, return_false);
def(AST_Constant, return_false);
def(AST_Super, return_false);
def(AST_This, return_false);
def(AST_Call, function(compressor){
@@ -2787,6 +2789,7 @@ merge(Compressor.prototype, {
def(AST_Node, return_this);
def(AST_Constant, return_null);
def(AST_Super, return_null);
def(AST_This, return_null);
def(AST_Call, function(compressor, first_in_statement){
if (!this.is_expr_pure(compressor)) {