vercel
next.js
BlogDocsChangelog

Turbopack: Fix compound assignment expression evaluation (#85478)

#85593Merged
Comparing
hayes/compound-assignment
(
021db30
) with
canary
(
137dbec
)
CodSpeed Performance Gauge
+8%
Improvements
5
Untouched
3
Skipped
12

Benchmarks

Skipped (12)

Improved

app-page-turbo.runtime.prod.js[full]
turbopack/crates/turbopack-ecmascript/benches/references.rs::references_benches::benchmark::references
CodSpeed Performance Gauge
+8%
823.1 ms761.2 ms
jsonwebtoken.js[full]
turbopack/crates/turbopack-ecmascript/benches/references.rs::references_benches::benchmark::references
CodSpeed Performance Gauge
+7%
366.7 ms344 ms
react-dom-client.development.js[full]
turbopack/crates/turbopack-ecmascript/benches/references.rs::references_benches::benchmark::references
CodSpeed Performance Gauge
+6%
463.1 ms437.6 ms
jsonwebtoken.js[tracing]
turbopack/crates/turbopack-ecmascript/benches/references.rs::references_benches::benchmark::references
CodSpeed Performance Gauge
+4%
324.3 ms310.7 ms
app-page-turbo.runtime.prod.js[tracing]
turbopack/crates/turbopack-ecmascript/benches/references.rs::references_benches::benchmark::references
CodSpeed Performance Gauge
+3%
667.7 ms645.8 ms

Passed

packages-bundle.js[full]
turbopack/crates/turbopack-ecmascript/benches/references.rs::references_benches::benchmark::references
CodSpeed Performance Gauge
+2%
1.3 s1.3 s
packages-bundle.js[tracing]
turbopack/crates/turbopack-ecmascript/benches/references.rs::references_benches::benchmark::references
CodSpeed Performance Gauge
0%
1.1 s1.1 s
react-dom-client.development.js[tracing]
turbopack/crates/turbopack-ecmascript/benches/references.rs::references_benches::benchmark::references
CodSpeed Performance Gauge
0%
382.6 ms383.3 ms

Commits

Click on a commit to change the comparison range
Base
canary
137dbec
+8.14%
Turbopack: Fix compound assignment expression evaluation (#85478) fixes #85474 Previously, the analyzer treated all assignment expressions the same way, evaluating them as their right-hand side value. This was incorrect for compound assignments (+=, -=, *=, |=, >>=, etc.), which compute a new value based on both the left and right operands. This commit distinguishes between simple assignments (=) and compound assignments. Simple assignments continue to evaluate to the right-hand side, while compound assignments are now properly marked as unknown values with side effects. Also adds tests for compound assignments in conditionals, covering bitshift operations (>>=, <<=, >>>=) and bitwise operations (|=, &=, ^=) with both numbers and bigints. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Co-authored-by: JJ Kasper <jj@jjsweb.site>
021db30
13 days ago
by hayes
© 2025 CodSpeed Technology
Home Terms Privacy Docs