oxc/tasks/minsize
sapphi-red 8d52cd0a5e
feat(minifier): merge assign expression in conditional expression (#8345)
compresses `a ? b = 0 : b = 1` into `b = a ? 0 : 1`

This can be done when `b` is an IdentifierReference and the assignment operator is `=`.

In this circumstance, the evaluation of `b = a ? 0 : 1` is:

1. Let lref be ? Evaluation of LeftHandSideExpression. (this does not have a side effect when LeftHandSideExpression is an IdentifierReference)
2. Let rref be ? Evaluation of AssignmentExpression. (ConditionalExpression is evaluated here)
3. Let rval be ? GetValue(rref).
4. Perform ? PutValue(lref, rval).
5. Return rval.

**References**
- [spec of `=`](https://262.ecma-international.org/15.0/index.html#sec-assignment-operators-runtime-semantics-evaluation)
- [spec of `? :`](https://262.ecma-international.org/15.0/index.html#sec-conditional-operator-runtime-semantics-evaluation)
2025-01-08 13:34:12 +00:00
..
src feat(minifier): fold if(x)return;y -> if(!x)y (#8226) 2025-01-03 05:24:53 +00:00
Cargo.toml chore(tasks): print diff for minify idempotency assertion (#8161) 2024-12-29 00:55:45 +08:00
minsize.snap feat(minifier): merge assign expression in conditional expression (#8345) 2025-01-08 13:34:12 +00:00
README.md

Track Minification size

See minification-benchmarks for baseline.