Keep unused function arguments by default
Discarding unused function arguments affects function.length, which can lead to some hard to debug issues. This optimization is now done only in "unsafe mode". Fix #121
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
unused_funarg_1: {
|
||||
options = { unused: true };
|
||||
options = { unused: true, unsafe: true };
|
||||
input: {
|
||||
function f(a, b, c, d, e) {
|
||||
return a + b;
|
||||
@@ -13,7 +13,7 @@ unused_funarg_1: {
|
||||
}
|
||||
|
||||
unused_funarg_2: {
|
||||
options = { unused: true };
|
||||
options = { unused: true, unsafe: true };
|
||||
input: {
|
||||
function f(a, b, c, d, e) {
|
||||
return a + c;
|
||||
@@ -165,7 +165,7 @@ used_var_in_catch: {
|
||||
}
|
||||
|
||||
keep_fnames: {
|
||||
options = { unused: true, keep_fnames: true };
|
||||
options = { unused: true, keep_fnames: true, unsafe: true };
|
||||
input: {
|
||||
function foo() {
|
||||
return function bar(baz) {};
|
||||
@@ -176,4 +176,4 @@ keep_fnames: {
|
||||
return function bar() {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user