@@ -7041,7 +7041,7 @@ merge(Compressor.prototype, {
|
|||||||
&& fn.is_constant_expression(find_scope(compressor)))
|
&& fn.is_constant_expression(find_scope(compressor)))
|
||||||
&& (value = can_flatten_body(stat))
|
&& (value = can_flatten_body(stat))
|
||||||
&& !fn.contains_this()) {
|
&& !fn.contains_this()) {
|
||||||
var replacing = exp === fn || compressor.option("unused") && def.references.length - def.replaced == 1;
|
var replacing = exp === fn || def.single_use && def.references.length - def.replaced == 1;
|
||||||
if (can_substitute_directly()) {
|
if (can_substitute_directly()) {
|
||||||
var args = self.args.slice();
|
var args = self.args.slice();
|
||||||
var refs = [];
|
var refs = [];
|
||||||
|
|||||||
@@ -1104,3 +1104,33 @@ issue_4220: {
|
|||||||
}
|
}
|
||||||
expect_stdout: true
|
expect_stdout: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4222: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
toplevel: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
{
|
||||||
|
const a = function() {
|
||||||
|
return function() {};
|
||||||
|
};
|
||||||
|
var b = a();
|
||||||
|
}
|
||||||
|
b();
|
||||||
|
console.log(typeof a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
{
|
||||||
|
const a = function() {
|
||||||
|
return function() {};
|
||||||
|
};
|
||||||
|
var b = a();
|
||||||
|
}
|
||||||
|
b();
|
||||||
|
console.log(typeof a);
|
||||||
|
}
|
||||||
|
expect_stdout: true
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user