Commits
Click on a commit to change the comparison rangefix(minifier): validate RegExp patterns before marking as pure
Invalid RegExp patterns like `RegExp("[")` or invalid flags like
`RegExp("a", "xyz")` throw SyntaxError at runtime, so they should
not be removed by the minifier.
This change uses `oxc_regular_expression` to validate patterns at
compile time:
- Valid patterns are marked as pure and can be removed when unused
- Invalid patterns or non-literal arguments are kept
Fixes #18050
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>