deduplicate AST_Super & AST_This logic (#2366)

This commit is contained in:
Alex Lam S.L
2017-10-17 04:19:53 +08:00
committed by GitHub
parent a89f126db6
commit b6a7ca292e
4 changed files with 30 additions and 8 deletions

View File

@@ -610,7 +610,6 @@ 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) {
@@ -2143,7 +2142,6 @@ 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){
@@ -2838,7 +2836,6 @@ 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)) {
@@ -4832,7 +4829,7 @@ merge(Compressor.prototype, {
var has_special_symbol = false;
self.walk(new TreeWalker(function(node) {
if (has_special_symbol) return true;
if (node instanceof AST_Super || node instanceof AST_This) {
if (node instanceof AST_This) {
has_special_symbol = true;
return true;
}