mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(transformer): RegExp transform do not transform invalid regexps (#5494)
Treat invalid regexps the same regardless of whether they have unsupported flags or not - don't transform them.
This commit is contained in:
parent
dd198231dc
commit
8f9627d1a1
1 changed files with 2 additions and 1 deletions
|
|
@ -150,8 +150,9 @@ impl<'a> Traverse<'a> for RegExp<'a> {
|
|||
}
|
||||
|
||||
let pattern_source: Cow<'_, str> = match ®exp.regex.pattern {
|
||||
RegExpPattern::Raw(raw) | RegExpPattern::Invalid(raw) => Cow::Borrowed(raw),
|
||||
RegExpPattern::Raw(raw) => Cow::Borrowed(raw),
|
||||
RegExpPattern::Pattern(p) => Cow::Owned(p.to_string()),
|
||||
RegExpPattern::Invalid(_) => return,
|
||||
};
|
||||
|
||||
let callee = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue