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:
parent
d787d70127
commit
1874ece864
|
|
@ -1804,6 +1804,7 @@ merge(Compressor.prototype, {
|
||||||
if (!compressor.option("keep_fargs")) {
|
if (!compressor.option("keep_fargs")) {
|
||||||
for (var a = node.argnames, i = a.length; --i >= 0;) {
|
for (var a = node.argnames, i = a.length; --i >= 0;) {
|
||||||
var sym = a[i];
|
var sym = a[i];
|
||||||
|
if (!sym) break;
|
||||||
if (!(sym.definition().id in in_use_ids)) {
|
if (!(sym.definition().id in in_use_ids)) {
|
||||||
a.pop();
|
a.pop();
|
||||||
compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", {
|
compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user