enhance arguments (#4296)

This commit is contained in:
Alex Lam S.L
2020-11-18 03:39:32 +00:00
committed by GitHub
parent 7a51c17ff0
commit 35283e5dd1
2 changed files with 28 additions and 3 deletions

View File

@@ -808,7 +808,7 @@ issue_4200: {
expect_stdout: "undefined"
}
issue_4291: {
issue_4291_1: {
options = {
arguments: true,
keep_fargs: "strict",
@@ -827,3 +827,27 @@ issue_4291: {
}
expect_stdout: "PASS"
}
issue_4291_2: {
options = {
arguments: true,
keep_fargs: "strict",
}
input: {
var a = function() {
if (arguments[0])
arguments[1] = "PASS";
return arguments;
}(42);
console.log(a[1], a[0], a.length);
}
expect: {
var a = function(argument_0) {
if (argument_0)
arguments[1] = "PASS";
return arguments;
}(42);
console.log(a[1], a[0], a.length);
}
expect_stdout: "PASS 42 1"
}