Skip to content

Commit

Permalink
test(lexer): assert size of Token in 32-bit WASM (#8292)
Browse files Browse the repository at this point in the history
`Token` should be 16 bytes in WASM too. Enable this test on 32-bit platforms.
  • Loading branch information
overlookmotel committed Jan 7, 2025
1 parent 0344e98 commit 16dcdaf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/oxc_parser/src/lexer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ pub struct Token {
_padding2: u32,
}

#[cfg(all(test, target_pointer_width = "64"))]
mod size_asserts {
const _: () = assert!(std::mem::size_of::<super::Token>() == 16);
}

impl Token {
pub(super) fn new_on_new_line() -> Self {
Self { is_on_new_line: true, ..Self::default() }
Expand All @@ -68,3 +63,9 @@ impl Token {
self.has_separator = true;
}
}

#[cfg(test)]
mod size_asserts {
use super::Token;
const _: () = assert!(std::mem::size_of::<Token>() == 16);
}

0 comments on commit 16dcdaf

Please sign in to comment.