enhance side_effects (#3410)

This commit is contained in:
Alex Lam S.L
2019-05-14 05:26:40 +08:00
committed by GitHub
parent 2e4fbdeb08
commit d538a73250
3 changed files with 62 additions and 11 deletions

View File

@@ -1161,3 +1161,29 @@ collapse_rhs_lhs: {
}
expect_stdout: "1 3"
}
drop_arguments: {
options = {
pure_getters: "strict",
side_effects: true,
}
input: {
(function() {
arguments.slice = function() {
console.log("PASS");
};
arguments[42];
arguments.length;
arguments.slice();
})();
}
expect: {
(function() {
arguments.slice = function() {
console.log("PASS");
};
arguments.slice();
})();
}
expect_stdout: "PASS"
}