parent
659c8a7632
commit
0ce389fd2a
|
|
@ -4075,9 +4075,10 @@ merge(Compressor.prototype, {
|
||||||
if (compressor.option("inline")
|
if (compressor.option("inline")
|
||||||
&& !fn.uses_arguments
|
&& !fn.uses_arguments
|
||||||
&& !fn.uses_eval
|
&& !fn.uses_eval
|
||||||
|
&& !(fn.name && fn instanceof AST_Function)
|
||||||
&& (value = can_flatten_body(stat))
|
&& (value = can_flatten_body(stat))
|
||||||
&& (exp === fn ? !fn.name
|
&& (exp === fn
|
||||||
: compressor.option("unused")
|
|| compressor.option("unused")
|
||||||
&& (def = exp.definition()).references.length == 1
|
&& (def = exp.definition()).references.length == 1
|
||||||
&& !recursive_ref(compressor, def)
|
&& !recursive_ref(compressor, def)
|
||||||
&& fn.is_constant_expression(exp.scope))
|
&& fn.is_constant_expression(exp.scope))
|
||||||
|
|
|
||||||
|
|
@ -1905,3 +1905,26 @@ duplicate_arg_var: {
|
||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_2737: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function(a) {
|
||||||
|
while (a());
|
||||||
|
})(function f() {
|
||||||
|
console.log(typeof f);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function(a) {
|
||||||
|
while (a());
|
||||||
|
})(function f() {
|
||||||
|
console.log(typeof f);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
expect_stdout: "function"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user