mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 12:51:57 +00:00
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)
27 lines
1.1 KiB
Text
27 lines
1.1 KiB
Text
| Oxc | ESBuild | Oxc | ESBuild |
|
|
Original | minified | minified | gzip | gzip | Fixture
|
|
-------------------------------------------------------------------------------------
|
|
72.14 kB | 23.68 kB | 23.70 kB | 8.61 kB | 8.54 kB | react.development.js
|
|
|
|
173.90 kB | 59.77 kB | 59.82 kB | 19.41 kB | 19.33 kB | moment.js
|
|
|
|
287.63 kB | 90.02 kB | 90.07 kB | 32.05 kB | 31.95 kB | jquery.js
|
|
|
|
342.15 kB | 118.12 kB | 118.14 kB | 44.51 kB | 44.37 kB | vue.js
|
|
|
|
544.10 kB | 71.72 kB | 72.48 kB | 26.15 kB | 26.20 kB | lodash.js
|
|
|
|
555.77 kB | 272.81 kB | 270.13 kB | 90.92 kB | 90.80 kB | d3.js
|
|
|
|
1.01 MB | 460.21 kB | 458.89 kB | 126.83 kB | 126.71 kB | bundle.min.js
|
|
|
|
1.25 MB | 652.53 kB | 646.76 kB | 163.51 kB | 163.73 kB | three.js
|
|
|
|
2.14 MB | 726 kB | 724.14 kB | 180.13 kB | 181.07 kB | victory.js
|
|
|
|
3.20 MB | 1.01 MB | 1.01 MB | 331.78 kB | 331.56 kB | echarts.js
|
|
|
|
6.69 MB | 2.32 MB | 2.31 MB | 492.61 kB | 488.28 kB | antd.js
|
|
|
|
10.95 MB | 3.50 MB | 3.49 MB | 908.24 kB | 915.50 kB | typescript.js
|
|
|