@@ -3344,7 +3344,9 @@ merge(Compressor.prototype, {
|
||||
if (is_undeclared_ref(this) && this.is_declared(compressor)) return false;
|
||||
if (this.is_immutable()) return false;
|
||||
var def = this.definition();
|
||||
if (is_arguments(def)) return def.scope.uses_arguments > 2;
|
||||
if (is_arguments(def) && all(def.scope.argnames, function(argname) {
|
||||
return argname instanceof AST_SymbolFunarg;
|
||||
})) return def.scope.uses_arguments > 2;
|
||||
var fixed = this.fixed_value();
|
||||
if (!fixed) return true;
|
||||
this._dot_throw = return_true;
|
||||
|
||||
@@ -1227,3 +1227,89 @@ issue_4483: {
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4485_1: {
|
||||
options = {
|
||||
pure_getters: "strict",
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
(function(a = null) {
|
||||
var arguments;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
(function(a = null) {
|
||||
var arguments;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})();
|
||||
}
|
||||
expect_stdout: true
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4485_2: {
|
||||
options = {
|
||||
pure_getters: "strict",
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
(function(a = null) {
|
||||
var arguments = null;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
(function(a = null) {
|
||||
var arguments = null;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})();
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4485_3: {
|
||||
options = {
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
(function(a = null) {
|
||||
var arguments;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
(function(a = null) {
|
||||
var arguments;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})();
|
||||
}
|
||||
expect_stdout: true
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
@@ -2215,3 +2215,90 @@ issue_4456: {
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4485_1: {
|
||||
options = {
|
||||
pure_getters: "strict",
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
(function([]) {
|
||||
var arguments;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})([]);
|
||||
}
|
||||
expect: {
|
||||
(function([]) {
|
||||
var arguments;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})([]);
|
||||
}
|
||||
expect_stdout: true
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4485_2: {
|
||||
options = {
|
||||
pure_getters: "strict",
|
||||
side_effects: true,
|
||||
}
|
||||
input: {
|
||||
(function([]) {
|
||||
var arguments = null;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})([]);
|
||||
}
|
||||
expect: {
|
||||
(function([]) {
|
||||
var arguments = null;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})([]);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4485_3: {
|
||||
options = {
|
||||
keep_fargs: false,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
(function([]) {
|
||||
var arguments;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})([]);
|
||||
}
|
||||
expect: {
|
||||
(function([]) {
|
||||
var arguments;
|
||||
try {
|
||||
arguments.length;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
}
|
||||
})([]);
|
||||
}
|
||||
expect_stdout: true
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user