Don't warn for an unreferenced exception symbol in a catch block.
authorArnavion <arnavion@gmail.com>
Sat, 13 Sep 2014 04:01:19 +0000 (21:01 -0700)
committerArnavion <arnavion@gmail.com>
Sat, 13 Sep 2014 04:01:19 +0000 (21:01 -0700)
lib/scope.js

index 1ce17fa..6f29921 100644 (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",