From: Mihai Bazon Date: Wed, 10 Oct 2012 08:37:51 +0000 (+0300) Subject: seems cleaner if AST_Label doesn't inherit from AST_SymbolDeclaration X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=dacce1b1fad07f5e62d62c52f05a42aa19c0e434;p=UglifyJS.git seems cleaner if AST_Label doesn't inherit from AST_SymbolDeclaration --- diff --git a/lib/ast.js b/lib/ast.js index 1ac19268..852f2a1f 100644 --- a/lib/ast.js +++ b/lib/ast.js @@ -785,7 +785,7 @@ var AST_Label = DEFNODE("Label", "references", { $propdoc: { references: "[AST_LabelRef*] a list of nodes referring to this label" } -}, AST_SymbolDeclaration); +}, AST_Symbol); var AST_SymbolRef = DEFNODE("SymbolRef", null, { $documentation: "Reference to some symbol (not definition/declaration)", diff --git a/lib/scope.js b/lib/scope.js index 7edce0e5..cd480841 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -533,7 +533,7 @@ AST_Toplevel.DEFMETHOD("scope_warnings", function(options){ AST_Node.warn("Eval is used [{file}:{line},{col}]", node.start); } if (options.unreferenced - && node instanceof AST_SymbolDeclaration + && (node instanceof AST_SymbolDeclaration || node instanceof AST_Label) && node.unreferenced()) { AST_Node.warn("{type} {name} is declared but not referenced [{file}:{line},{col}]", { type: node instanceof AST_Label ? "Label" : "Symbol",