From 1e5e13ed81fe96d4388ae7d9ff1402a871c436b7 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Thu, 8 Nov 2012 15:39:14 +0200 Subject: [PATCH] AST_LabelRef no longer inherits from AST_SymbolRef --- lib/ast.js | 2 +- lib/compress.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ast.js b/lib/ast.js index d55ec223..4b9f5988 100644 --- a/lib/ast.js +++ b/lib/ast.js @@ -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", diff --git a/lib/compress.js b/lib/compress.js index 1571173c..469ee6e2 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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()); } }); -- 2.34.1