fix corner case in unsafe evaluate (#4932)

fixes #4931
This commit is contained in:
Alex Lam S.L
2021-05-14 15:51:19 +01:00
committed by GitHub
parent 3c1898fd65
commit 7576048118
2 changed files with 26 additions and 3 deletions

View File

@@ -398,3 +398,24 @@ issue_4676: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4931: {
options = {
evaluate: true,
templates: true,
unsafe: true,
}
input: {
console.log(String.raw`${typeof A} ${"\r"}`);
console.log(String.raw`${"\\"} ${"`"}`);
}
expect: {
console.log(String.raw`${typeof A} ${"\r"}`);
console.log("\\ `");
}
expect_stdout: [
"undefined \r",
"\\ `",
]
node_version: ">=4"
}