enhance side_effects (#4124)

- add documentation for `merge_vars`
This commit is contained in:
Alex Lam S.L
2020-09-18 14:35:29 +01:00
committed by GitHub
parent 0f0759ec15
commit 38a46c86d7
3 changed files with 29 additions and 1 deletions

View File

@@ -245,6 +245,31 @@ unsafe_builtin_2: {
expect_stdout: "object PASS PASS"
}
unsafe_builtin_3: {
options = {
conditionals: true,
side_effects: true,
toplevel: true,
unsafe: true,
}
input: {
var o = {};
if (42 < Math.random())
o.p = "FAIL";
else
o.p = "PASS";
for (var k in o)
console.log(k, o[k]);
}
expect: {
var o = {};
o.p = 42 < Math.random() ? "FAIL" : "PASS";
for (var k in o)
console.log(k, o[k]);
}
expect_stdout: "p PASS"
}
unsafe_string_replace: {
options = {
side_effects: true,