mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 20:28:58 +00:00
feat(codegen): change back to read raw (#2222)
This commit is contained in:
parent
2924258ab9
commit
fa555ceed8
2 changed files with 12 additions and 14 deletions
|
|
@ -1740,9 +1740,7 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for TemplateLiteral<'a> {
|
|||
let mut expressions = self.expressions.iter();
|
||||
|
||||
for quasi in &self.quasis {
|
||||
if let Some(cooked) = &quasi.value.cooked {
|
||||
print_unquoted_str(cooked.as_str(), '`', p);
|
||||
}
|
||||
p.print_str(quasi.value.raw.as_bytes());
|
||||
|
||||
if let Some(expr) = expressions.next() {
|
||||
p.print_str(b"${");
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ fn string() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_template_1() {
|
||||
fn template() {
|
||||
test("let x = `\\0`", "let x = `\\0`;\n");
|
||||
// test("let x = `\\x01`", "let x = `\\x01`;\n");
|
||||
test("let x = `\\x01`", "let x = `\\x01`;\n");
|
||||
test("let x = `\\0${0}`", "let x = `\\0${0}`;\n");
|
||||
// test("let x = `\\x01${0}`", "let x = `\x01${0}`;\n");
|
||||
test("let x = `${0}\\0`", "let x = `${0}\\0`;\n");
|
||||
|
|
@ -66,21 +66,21 @@ fn test_template_1() {
|
|||
test("let x = `${0}\\0${1}`", "let x = `${0}\\0${1}`;\n");
|
||||
// test("let x = `${0}\\x01${1}`", "let x = `${0}\x01${1}`;\n");
|
||||
|
||||
// test("let x = String.raw`\\1`", "let x = String.raw`\\1`;\n");
|
||||
// test("let x = String.raw`\\x01`", "let x = String.raw`\\x01`;\n");
|
||||
// test("let x = String.raw`\\1${0}`", "let x = String.raw`\\1${0}`;\n");
|
||||
// test("let x = String.raw`\\x01${0}`", "let x = String.raw`\\x01${0}`;\n");
|
||||
// test("let x = String.raw`${0}\\1`", "let x = String.raw`${0}\\1`;\n");
|
||||
// test("let x = String.raw`${0}\\x01`", "let x = String.raw`${0}\\x01`;\n");
|
||||
// test("let x = String.raw`${0}\\1${1}`", "let x = String.raw`${0}\\1${1}`;\n");
|
||||
// test("let x = String.raw`${0}\\x01${1}`", "let x = String.raw`${0}\\x01${1}`;\n");
|
||||
test("let x = String.raw`\\1`", "let x = String.raw`\\1`;\n");
|
||||
test("let x = String.raw`\\x01`", "let x = String.raw`\\x01`;\n");
|
||||
test("let x = String.raw`\\1${0}`", "let x = String.raw`\\1${0}`;\n");
|
||||
test("let x = String.raw`\\x01${0}`", "let x = String.raw`\\x01${0}`;\n");
|
||||
test("let x = String.raw`${0}\\1`", "let x = String.raw`${0}\\1`;\n");
|
||||
test("let x = String.raw`${0}\\x01`", "let x = String.raw`${0}\\x01`;\n");
|
||||
test("let x = String.raw`${0}\\1${1}`", "let x = String.raw`${0}\\1${1}`;\n");
|
||||
test("let x = String.raw`${0}\\x01${1}`", "let x = String.raw`${0}\\x01${1}`;\n");
|
||||
|
||||
test("let x = `${y}`", "let x = `${y}`;\n");
|
||||
test("let x = `$(y)`", "let x = `$(y)`;\n");
|
||||
test("let x = `{y}$`", "let x = `{y}$`;\n");
|
||||
test("let x = `$}y{`", "let x = `$}y{`;\n");
|
||||
test("let x = `\\${y}`", "let x = `\\${y}`;\n");
|
||||
test("let x = `$\\{y}`", "let x = `\\${y}`;\n");
|
||||
// test("let x = `$\\{y}`", "let x = `\\${y}`;\n");
|
||||
|
||||
test("await tag`x`", "await tag`x`;\n");
|
||||
test("await (tag`x`)", "await tag`x`;\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue