mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(transformer): RegExp transform unbox early (#5504)
Unbox the `RegExpLiteral` early to avoid all lookups thereafter going through the indirection of a `Box`.
This commit is contained in:
parent
d1ece197c4
commit
fad0a0548b
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue