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`.
This commit is contained in:
Armagan Amcalar 2017-03-07 03:42:42 +01:00 committed by GitHub
parent d787d70127
commit 1874ece864

View File

@ -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}]", {