Skip to content

Incorrect minification of new Array(Foo, ...Bar) drops spread arguments #22185

@pranavjindal999

Description

@pranavjindal999

When minification is enabled, OXC incorrectly transforms:

new Array(Foo, ...Bar)

into

[Foo]

This drops the spread arguments entirely and is a major bug.

✅ Expected output

[Foo, ...Bar]

⚠️ This is critical

  • Produces incorrect JavaScript
  • Silent runtime behavior changes
  • Data loss due to dropped spread elements

Reproducible link

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions