fix corner case with template literals (#4631)

fixes #4630
This commit is contained in:
Alex Lam S.L
2021-02-09 06:21:15 +00:00
committed by GitHub
parent fcee32527b
commit 14fedbf123
2 changed files with 16 additions and 0 deletions

View File

@@ -249,6 +249,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
if (peek() == "{") {
next();
strings.push(s);
S.regex_allowed = true;
return true;
}
}

View File

@@ -283,3 +283,18 @@ issue_4606: {
expect_stdout: "undefined \r \\ `"
node_version: ">=4"
}
issue_4630: {
options = {
evaluate: true,
templates: true,
}
input: {
console.log(`${/PASS/}`);
}
expect: {
console.log("/PASS/");
}
expect_stdout: "/PASS/"
node_version: ">=4"
}