mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(parser): mark ByteHandlers unsafe (#2212)
All the ASCII `ByteHandler`s are unsafe to call. I forgot to mark them as unsafe when making that change. This PR fixes that, and will make it harder for someone to accidentally call one of them without considering the safety invariants.
This commit is contained in:
parent
20679d1e1e
commit
51ac392ae4
1 changed files with 1 additions and 1 deletions
|
|
@ -1292,7 +1292,7 @@ unsafe fn handle_byte(byte: u8, lexer: &mut Lexer) -> Kind {
|
|||
BYTE_HANDLERS[byte as usize](lexer)
|
||||
}
|
||||
|
||||
type ByteHandler = fn(&mut Lexer<'_>) -> Kind;
|
||||
type ByteHandler = unsafe fn(&mut Lexer<'_>) -> Kind;
|
||||
|
||||
/// Lookup table mapping any incoming byte to a handler function defined below.
|
||||
/// <https://github.com/ratel-rust/ratel-core/blob/master/ratel/src/lexer/mod.rs>
|
||||
|
|
|
|||
Loading…
Reference in a new issue