fix corner case in unsafe (#3380)

This commit is contained in:
Alex Lam S.L
2019-04-24 22:21:28 +08:00
committed by GitHub
parent 6fe20dbe33
commit d3b93ec682
3 changed files with 38 additions and 0 deletions

View File

@@ -1712,3 +1712,21 @@ unsafe_escaped: {
}
expect_stdout: "PASS"
}
unsafe_string_replace: {
options = {
evaluate: true,
unsafe: true,
}
input: {
"foo".replace("f", function() {
console.log("PASS");
});
}
expect: {
"foo".replace("f", function() {
console.log("PASS");
});
}
expect_stdout: "PASS"
}