Merge pull request #549 from Arnavion/unreferenced-catch-symbol

Don't warn for an unreferenced exception symbol in a catch block.
This commit is contained in:
Mihai Bazon 2014-09-13 09:29:34 +03:00
commit f0c1a01bc2

View File

@ -532,6 +532,7 @@ AST_Toplevel.DEFMETHOD("scope_warnings", function(options){
}
if (options.unreferenced
&& (node instanceof AST_SymbolDeclaration || node instanceof AST_Label)
&& !(node instanceof AST_SymbolCatch)
&& node.unreferenced()) {
AST_Node.warn("{type} {name} is declared but not referenced [{file}:{line},{col}]", {
type: node instanceof AST_Label ? "Label" : "Symbol",