@@ -9575,7 +9575,8 @@ merge(Compressor.prototype, {
|
|||||||
&& expr instanceof AST_SymbolRef
|
&& expr instanceof AST_SymbolRef
|
||||||
&& is_arguments(def = expr.definition())
|
&& is_arguments(def = expr.definition())
|
||||||
&& prop instanceof AST_Number
|
&& prop instanceof AST_Number
|
||||||
&& (fn = expr.scope.resolve()) === find_lambda()) {
|
&& (fn = expr.scope.resolve()) === find_lambda()
|
||||||
|
&& fn.uses_arguments !== "d") {
|
||||||
var index = prop.value;
|
var index = prop.value;
|
||||||
if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") {
|
if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") {
|
||||||
if (!def.deleted) def.deleted = [];
|
if (!def.deleted) def.deleted = [];
|
||||||
|
|||||||
@@ -235,7 +235,11 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
|
|||||||
if (!sym) {
|
if (!sym) {
|
||||||
sym = self.def_global(node);
|
sym = self.def_global(node);
|
||||||
} else if (name == "arguments" && sym.scope instanceof AST_Lambda) {
|
} else if (name == "arguments" && sym.scope instanceof AST_Lambda) {
|
||||||
sym.scope.uses_arguments = true;
|
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") {
|
if (name == "eval") {
|
||||||
var parent = tw.parent();
|
var parent = tw.parent();
|
||||||
|
|||||||
@@ -807,3 +807,23 @@ issue_4200: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "undefined"
|
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