diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-10-10 11:37:51 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-10-10 11:37:51 +0300 |
commit | dacce1b1fad07f5e62d62c52f05a42aa19c0e434 (patch) | |
tree | fee68ff967fe1d9d72bc82221a2e70811fbbd512 | |
parent | f26f3b44bc238c5ea9772ccea5a21c9c928b6fd9 (diff) | |
download | tracifyjs-dacce1b1fad07f5e62d62c52f05a42aa19c0e434.tar.gz tracifyjs-dacce1b1fad07f5e62d62c52f05a42aa19c0e434.zip |
seems cleaner if AST_Label doesn't inherit from AST_SymbolDeclaration
-rw-r--r-- | lib/ast.js | 2 | ||||
-rw-r--r-- | lib/scope.js | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -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", |