aboutsummaryrefslogtreecommitdiff
path: root/lib/scope.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2014-09-13 09:29:34 +0300
committerMihai Bazon <mihai.bazon@gmail.com>2014-09-13 09:29:34 +0300
commitf0c1a01bc260b8fb82e340e872a25b39eabf7200 (patch)
tree2a662be4fcf301bd5a96be8bb672a35f6cd79345 /lib/scope.js
parent57dab1e1db7ed542ce9ace7caa3141130edffe12 (diff)
parent7be680d3f8fe0b17d01c8e4aea5a95dcb97b43c8 (diff)
downloadtracifyjs-f0c1a01bc260b8fb82e340e872a25b39eabf7200.tar.gz
tracifyjs-f0c1a01bc260b8fb82e340e872a25b39eabf7200.zip
Merge pull request #549 from Arnavion/unreferenced-catch-symbol
Don't warn for an unreferenced exception symbol in a catch block.
Diffstat (limited to 'lib/scope.js')
-rw-r--r--lib/scope.js1
1 files changed, 1 insertions, 0 deletions
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",