Skip to content

minifier: regex constructor call with invalid pattern is removed incorrectly #18050

Description

@sapphi-red
const a1 = RegExp("[")
const a2 = RegExp("[")
const b1 = RegExp("a", "xyz")
const b2 = RegExp("a", "xyz")

These are invalid and throws an error, but is incorrectly removed by the minifier.

playground

related: rolldown/rolldown#7916

Metadata

Metadata

Assignees

Labels

Type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions