fix corner case with arguments (#4486)

fixes #4485
This commit is contained in:
Alex Lam S.L
2020-12-31 06:55:05 +00:00
committed by GitHub
parent 8b954b022b
commit 0b7d65d331
3 changed files with 176 additions and 1 deletions

View File

@@ -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"
}