AST_LabelRef no longer inherits from AST_SymbolRef
authorMihai Bazon <mihai@bazon.net>
Thu, 8 Nov 2012 13:39:14 +0000 (15:39 +0200)
committerMihai Bazon <mihai@bazon.net>
Thu, 8 Nov 2012 13:39:14 +0000 (15:39 +0200)
lib/ast.js
lib/compress.js

index d55ec22..4b9f598 100644 (file)
@@ -810,7 +810,7 @@ var AST_SymbolRef = DEFNODE("SymbolRef", null, {
 
 var AST_LabelRef = DEFNODE("LabelRef", null, {
     $documentation: "Reference to a label symbol",
-}, AST_SymbolRef);
+}, AST_Symbol);
 
 var AST_This = DEFNODE("This", null, {
     $documentation: "The `this` symbol",
index 1571173..469ee6e 100644 (file)
@@ -885,7 +885,7 @@ merge(Compressor.prototype, {
                         });
                         return true;
                     }
-                    if (node instanceof AST_SymbolRef && !(node instanceof AST_LabelRef)) {
+                    if (node instanceof AST_SymbolRef) {
                         push_uniq(in_use, node.definition());
                         return true;
                     }
@@ -908,8 +908,7 @@ merge(Compressor.prototype, {
                     if (decl instanceof AST_SymbolDeclaration) {
                         decl.init.forEach(function(init){
                             var tw = new TreeWalker(function(node){
-                                if (node instanceof AST_SymbolRef
-                                    && !(node instanceof AST_LabelRef)) {
+                                if (node instanceof AST_SymbolRef) {
                                     push_uniq(in_use, node.definition());
                                 }
                             });