@@ -9575,7 +9575,8 @@ merge(Compressor.prototype, {
|
||||
&& expr instanceof AST_SymbolRef
|
||||
&& is_arguments(def = expr.definition())
|
||||
&& prop instanceof AST_Number
|
||||
&& (fn = expr.scope.resolve()) === find_lambda()) {
|
||||
&& (fn = expr.scope.resolve()) === find_lambda()
|
||||
&& fn.uses_arguments !== "d") {
|
||||
var index = prop.value;
|
||||
if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") {
|
||||
if (!def.deleted) def.deleted = [];
|
||||
|
||||
@@ -235,8 +235,12 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
|
||||
if (!sym) {
|
||||
sym = self.def_global(node);
|
||||
} else if (name == "arguments" && sym.scope instanceof AST_Lambda) {
|
||||
if (!(tw.parent() instanceof AST_PropAccess)) {
|
||||
sym.scope.uses_arguments = "d";
|
||||
} else if (!sym.scope.uses_arguments) {
|
||||
sym.scope.uses_arguments = true;
|
||||
}
|
||||
}
|
||||
if (name == "eval") {
|
||||
var parent = tw.parent();
|
||||
if (parent.TYPE == "Call" && parent.expression === node) {
|
||||
|
||||
@@ -807,3 +807,23 @@ issue_4200: {
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
issue_4291: {
|
||||
options = {
|
||||
arguments: true,
|
||||
keep_fargs: "strict",
|
||||
}
|
||||
input: {
|
||||
console.log(function() {
|
||||
arguments[0] = "PASS";
|
||||
return arguments;
|
||||
}()[0]);
|
||||
}
|
||||
expect: {
|
||||
console.log(function() {
|
||||
arguments[0] = "PASS";
|
||||
return arguments;
|
||||
}()[0]);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user