&& 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 = [];
if (!sym) {
sym = self.def_global(node);
} 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") {
var parent = tw.parent();
}
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"
+}