seems cleaner if AST_Label doesn't inherit from AST_SymbolDeclaration
This commit is contained in:
@@ -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)",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user