From: Arnavion Date: Sat, 13 Sep 2014 04:01:19 +0000 (-0700) Subject: Don't warn for an unreferenced exception symbol in a catch block. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=7be680d3f8fe0b17d01c8e4aea5a95dcb97b43c8;p=UglifyJS.git Don't warn for an unreferenced exception symbol in a catch block. --- diff --git a/lib/scope.js b/lib/scope.js index 1ce17fa6..6f29921f 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -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",