improve global context enumeration under sandbox (#4812)

fixes #4811
This commit is contained in:
Alex Lam S.L
2021-03-22 14:43:33 +00:00
committed by GitHub
parent 9c01511f84
commit 51bdb7281b
3 changed files with 57 additions and 4 deletions

View File

@@ -172,3 +172,32 @@ issue_4054: {
}
expect_stdout: "{ p: [Setter] }"
}
issue_4811_1: {
input: {
for (var PASS in this);
console.log(PASS, this);
}
expect: {
for (var PASS in this);
console.log(PASS, this);
}
expect_stdout: "PASS [object global]"
}
issue_4811_2: {
options = {
side_effects: true,
}
input: {
(async function() {});
for (var PASS in this);
console.log(PASS, this);
}
expect: {
for (var PASS in this);
console.log(PASS, this);
}
expect_stdout: "PASS [object global]"
node_version: ">=8"
}