Skip to content

Commit 684ce39

Browse files
committed
WIP: 4120 passed
1 parent 162af8c commit 684ce39

File tree

1 file changed

+9
-1
lines changed
  • crates/swc_ecma_codegen/src

1 file changed

+9
-1
lines changed

crates/swc_ecma_codegen/src/lit.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,24 +452,32 @@ pub fn get_quoted_utf16(v: &str, ascii_only: bool, target: EsVersion) -> (AsciiC
452452
let range = if is_curly {
453453
3..(inner_buf.len() - 1)
454454
} else {
455-
2..6
455+
3..7
456456
};
457457

458458
if is_valid {
459459
let val_str = &inner_buf[range];
460+
dbg!(&val_str);
460461
if let Ok(v) = u32::from_str_radix(val_str, 16) {
462+
dbg!(&v);
463+
461464
if v > 0xffff {
465+
dbg!("push");
462466
buf.push_str(&inner_buf);
463467
let end = if is_curly { 7 } else { 5 };
464468
for _ in 0..end {
465469
iter.next();
466470
}
467471
} else if (0xd800..=0xdfff).contains(&v) {
472+
dbg!("push: \\");
468473
buf.push('\\');
469474
} else {
475+
dbg!("push: \\\\");
470476
buf.push_str("\\\\");
471477
}
472478
} else {
479+
dbg!("push: \\\\ (invalid)");
480+
473481
buf.push_str("\\\\");
474482
}
475483
} else {

0 commit comments

Comments
 (0)