enhance side_effects (#5578)

This commit is contained in:
Alex Lam S.L
2022-07-27 21:06:11 +01:00
committed by GitHub
parent da930affd2
commit db6fd6db3e
2 changed files with 45 additions and 13 deletions

View File

@@ -318,6 +318,32 @@ unsafe_string_replace: {
expect_stdout: "PASS"
}
unsafe_Object_call: {
options = {
side_effects: true,
unsafe: true,
}
input: {
var o = {
f: function(a) {
console.log(a ? this.p : "FAIL 1");
},
p: "FAIL 2",
}, p = "PASS";
Object(o.f)(42);
}
expect: {
var o = {
f: function(a) {
console.log(a ? this.p : "FAIL 1");
},
p: "FAIL 2",
}, p = "PASS";
(0, o.f)(42);
}
expect_stdout: "PASS"
}
drop_value: {
options = {
side_effects: true,