Skip to content

fix(es/minifier): preserve undefined parameter defaults - #12233

Open
labor0-bot[bot] wants to merge 4 commits into
mainfrom
fix-12203-preserve-undefined-parameter-defaults
Open

labor0-bot[bot] wants to merge 4 commits into
mainfrom
fix-12203-preserve-undefined-parameter-defaults

Conversation

@labor0-bot

@labor0-bot labor0-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Description:

Preserve root function-parameter defaults that evaluate to undefined. Removing
them changes Function.length and turns non-arrow functions with an otherwise
simple parameter list into functions with mapped arguments.

The pure minifier now visits parameter-pattern children without simplifying the
root pattern. This retains observable parameter defaults while preserving the
existing simplification for nested and non-parameter patterns.

Adds SWC-owned issue fixtures covering function arity, mapped arguments, and a
non-parameter destructuring control.

Related issue (if exists):

Closes #12203

Verification:

  • UPDATE=1 cargo test -p swc_ecma_minifier
  • cargo test -p swc_ecma_minifier
  • ./scripts/test.sh
  • ./scripts/exec.sh
  • cargo fmt --all
  • cargo clippy --all --all-targets -- -D warnings is blocked because hosted-runner policy disables git submodule update --init --recursive; required HTML5lib and Test262 fixture submodules are unavailable.

@labor0-bot
labor0-bot Bot requested a review from a team as a code owner September 5, 2026 11:09
@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f009735

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@labor0-bot

labor0-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Continue working with Labor0

Submit a formal review from Files changed, or leave an inline review comment; neither requires an @mention. To request work from Conversation, include @labor0-bot plus a meaningful instruction in the comment.

Reviews from collaborators with Write, Maintain, or Admin access are handled automatically. Ask a question for an explanation, or request a code change and Labor0 will evaluate it and update this pull request when appropriate.

Successful change requests update the branch without a routine completion reply. Labor0 replies to questions and non-actionable feedback and resolves each processed inline review thread unless clarification is required. Conversation comments have no review thread to resolve. Automated review boilerplate paired with selected inline feedback does not receive a separate reply. Related feedback may be handled together, so wait for any necessary replies, new commits, and required checks before merging.

Learn more


Labor0 task status

  • Status: Waiting for review or merge
  • Current work: None
  • Last updated: 2026-09-05 12:59 UTC

Open the Labor0 task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8bc9f59171

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".

Comment thread crates/swc_ecma_minifier/src/compress/pure/mod.rs
@codspeed

codspeed Bot commented Sep 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 200 untouched benchmarks
⏩ 61 skipped benchmarks1


Comparing fix-12203-preserve-undefined-parameter-defaults (f009735) with main (dcbcf93)2

Open in CodSpeed

Footnotes

  1. 61 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (4a73df1) during the generation of this report, so dcbcf93 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@kdy1 Donny/강동윤 (kdy1) changed the title fix(minifier): preserve undefined parameter defaults fix(es/minifier): preserve undefined parameter defaults Sep 5, 2026
@kdy1
Donny/강동윤 (kdy1) enabled auto-merge (squash) September 5, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

es/minifier: removing undefined defaults changes parameter list semantics

2 participants