Skip to content

fix(codegen): separate division from generated pure annotations - #1826

Open
Elecmonkey (elecmonkey) wants to merge 1 commit into
swc-project:mainfrom
elecmonkey:fix/codegen-pure-division
Open

Elecmonkey (elecmonkey) wants to merge 1 commit into
swc-project:mainfrom
elecmonkey:fix/codegen-pure-division

Conversation

@elecmonkey

Copy link
Copy Markdown
Contributor

Motivation

When a pure-marked call follows a division operator, minified output can turn 8 / pure() into 8//* #__PURE__ */ pure(). JavaScript reads // as a line comment, which can swallow the rest of the function and leave it without a closing brace.

Changes

Insert a space before the generated annotation when the preceding byte is /.

Related Links

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-04T18:40:53.753412Z
We couldn’t complete this review. Comment @codex review to try again.
d231fdd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Fork CI results

Commit: d231fdd4361eb33fa770e6aecc63ea6446e477bc

Workflow Result Run
Binary Size success View workflow run
Profile Performance success View workflow run
JavaScript API Gungraun success View workflow run

This branch has not been deployed

No deployments
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.

codegen: separate a generated pure annotation from division

1 participant