mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(parser): remove unsafe code (#2527)
Remove some unnecessary unsafe code.
This commit is contained in:
parent
02c82c3f78
commit
0ddfc856d2
1 changed files with 4 additions and 5 deletions
|
|
@ -51,16 +51,15 @@ macro_rules! handle_string_literal {
|
|||
handle_string_literal_escape!($lexer, $delimiter, $table, after_opening_quote)
|
||||
})
|
||||
},
|
||||
b'\r' | b'\n' => {
|
||||
// This is impossible in valid JS, so cold path
|
||||
_ => {
|
||||
// Line break. This is impossible in valid JS, so cold path.
|
||||
cold_branch(|| {
|
||||
debug_assert!(matches!(next_byte, b'\r' | b'\n'));
|
||||
$lexer.consume_char();
|
||||
$lexer.error(diagnostics::UnterminatedString($lexer.unterminated_range()));
|
||||
Kind::Undetermined
|
||||
})
|
||||
},
|
||||
// SAFETY: Macro user guarantees `$table` does not match any other bytes
|
||||
_ => assert_unchecked::unreachable_unchecked!()
|
||||
}
|
||||
}
|
||||
},
|
||||
handle_eof: || {
|
||||
|
|
|
|||
Loading…
Reference in a new issue