Skip to content

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Aug 15, 2025

Treat [...arguments] as side effect free.

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Aug 15, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sapphi-red sapphi-red marked this pull request as ready for review August 15, 2025 09:29
Copilot AI review requested due to automatic review settings August 15, 2025 09:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR treats [...arguments] as side effect free within function scopes to improve JavaScript minification capabilities. The change recognizes that spreading the arguments object in an array literal doesn't have side effects when arguments refers to the built-in function parameter object.

Key changes:

  • Modified side effect analysis to treat arguments identifier as side effect free when it's a global reference
  • Added arguments to the set of global variable names in the test context
  • Added test coverage for the new behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_minifier/tests/ecmascript/may_have_side_effects.rs Adds arguments to global variables and includes test for [...arguments] behavior
crates/oxc_ecmascript/src/side_effects/may_have_side_effects.rs Implements logic to treat arguments identifier as side effect free in array spread context

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 15, 2025

CodSpeed Instrumentation Performance Report

Merging #13116 will not alter performance

Comparing 08-15-feat_ecmascript_treat_.arguments_as_side_effect_free (36386e4) with main (8459a12)1

Summary

✅ 34 untouched benchmarks

Footnotes

  1. No successful run was found on main (36386e4) during the generation of this report, so 8459a12 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Aug 16, 2025
Copy link
Member

Boshen commented Aug 16, 2025

Merge activity

Treat `[...arguments]` as side effect free.
@graphite-app graphite-app bot force-pushed the 08-15-feat_ecmascript_treat_.arguments_as_side_effect_free branch from d81faa7 to 36386e4 Compare August 16, 2025 02:46
@graphite-app graphite-app bot merged commit 36386e4 into main Aug 16, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-15-feat_ecmascript_treat_.arguments_as_side_effect_free branch August 16, 2025 02:52
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-minifier Area - Minifier C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants