@@ -7778,8 +7778,9 @@ merge(Compressor.prototype, {
|
|||||||
if (!all(args, function(arg) {
|
if (!all(args, function(arg) {
|
||||||
return !(arg instanceof AST_Spread);
|
return !(arg instanceof AST_Spread);
|
||||||
})) return;
|
})) return;
|
||||||
|
var is_iife = fn === exp && !fn.name;
|
||||||
if (fn.rest) {
|
if (fn.rest) {
|
||||||
if (!compressor.option("rests")) return;
|
if (!(is_iife && compressor.option("rests"))) return;
|
||||||
var insert = fn.argnames.length;
|
var insert = fn.argnames.length;
|
||||||
for (var i = args.length; i < insert; i++) {
|
for (var i = args.length; i < insert; i++) {
|
||||||
args[i] = make_node(AST_Undefined, call).optimize(compressor);
|
args[i] = make_node(AST_Undefined, call).optimize(compressor);
|
||||||
@@ -7789,7 +7790,6 @@ merge(Compressor.prototype, {
|
|||||||
fn.rest = null;
|
fn.rest = null;
|
||||||
}
|
}
|
||||||
var pos = 0, last = 0;
|
var pos = 0, last = 0;
|
||||||
var is_iife = fn === exp && !fn.name;
|
|
||||||
var drop_defaults = is_iife && compressor.option("default_values");
|
var drop_defaults = is_iife && compressor.option("default_values");
|
||||||
var drop_fargs = is_iife && compressor.drop_fargs(fn, call) ? function(argname, arg) {
|
var drop_fargs = is_iife && compressor.drop_fargs(fn, call) ? function(argname, arg) {
|
||||||
if (!argname) return true;
|
if (!argname) return true;
|
||||||
|
|||||||
@@ -525,3 +525,22 @@ issue_4525_2: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4538: {
|
||||||
|
options = {
|
||||||
|
rests: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
console.log(typeof function f(...a) {
|
||||||
|
return a.p, f;
|
||||||
|
}()());
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log(typeof function f(...a) {
|
||||||
|
return a.p, f;
|
||||||
|
}()());
|
||||||
|
}
|
||||||
|
expect_stdout: "function"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user