From 1874ece864c1bda63606fbc9b789d93e977128d9 Mon Sep 17 00:00:00 2001 From: Armagan Amcalar Date: Tue, 7 Mar 2017 03:42:42 +0100 Subject: [PATCH] Fix undefined symbols in compression Dropping unused declarations while compressing sometimes crash. This is due to the symbols being undefined where the source code tries to access `sym.definition().id`. --- lib/compress.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/compress.js b/lib/compress.js index 696e2056..5b97ee30 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1804,6 +1804,7 @@ merge(Compressor.prototype, { if (!compressor.option("keep_fargs")) { for (var a = node.argnames, i = a.length; --i >= 0;) { var sym = a[i]; + if (!sym) break; if (!(sym.definition().id in in_use_ids)) { a.pop(); compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", {