From 4b0119b83c5deb7b2dd93bab5d96473c55a3825a Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Thu, 5 Sep 2024 17:38:06 +0100 Subject: [PATCH] refactor(transformer): RegExp transform unbox early --- crates/oxc_transformer/src/regexp/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/oxc_transformer/src/regexp/mod.rs b/crates/oxc_transformer/src/regexp/mod.rs index d8942b270980e7..68aac4ffafe457 100644 --- a/crates/oxc_transformer/src/regexp/mod.rs +++ b/crates/oxc_transformer/src/regexp/mod.rs @@ -113,9 +113,10 @@ impl<'a> Traverse<'a> for RegExp<'a> { expr: &mut Expression<'a>, ctx: &mut oxc_traverse::TraverseCtx<'a>, ) { - let Expression::RegExpLiteral(ref mut regexp) = expr else { + let Expression::RegExpLiteral(regexp) = expr else { return; }; + let regexp = regexp.as_mut(); let flags = regexp.regex.flags; let has_unsupported_flags = flags.intersects(self.unsupported_flags);