aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-10-10 11:37:51 +0300
committerMihai Bazon <mihai@bazon.net>2012-10-10 11:37:51 +0300
commitdacce1b1fad07f5e62d62c52f05a42aa19c0e434 (patch)
treefee68ff967fe1d9d72bc82221a2e70811fbbd512
parentf26f3b44bc238c5ea9772ccea5a21c9c928b6fd9 (diff)
downloadtracifyjs-dacce1b1fad07f5e62d62c52f05a42aa19c0e434.tar.gz
tracifyjs-dacce1b1fad07f5e62d62c52f05a42aa19c0e434.zip
seems cleaner if AST_Label doesn't inherit from AST_SymbolDeclaration
-rw-r--r--lib/ast.js2
-rw-r--r--lib/scope.js2
2 files changed, 2 insertions, 2 deletions
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",