Repository navigation
Commit 0c6e9d8
authored
feat(javascript): merge consecutive
* feat(javascript): merge consecutive `if`s returning or throwing the same value in the minifier
`if (a) return x; if (b) return x;` becomes `if (a || b) return x;`, and
`throw` alike: the second test runs only where the first did not leave.
Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD
* test(javascript): fit two minifier tests to #22473 and #22499 together
#22473 counts a conversion as code that may run, so the value
#22499's improved case moved past `console` now has effects and
stays put; it now moves a comparison, which converts nothing. And
#22499 now shortens #22473's literal case, whose assertion holds the
output to terser's, so that case runs with the improve phase off.
With both in, `vercel/ms` is bigger than oxc's output again (787
against 781 gzip), so it goes back on OXC_SMALLER, where #22499 had
retired it on its own.
Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeDifs returning or throwing the same value in the minifier (#22507)1 parent cb7a4f1 commit 0c6e9d8
4 files changed
Lines changed: 83 additions & 8 deletions
File tree
- lib/javascript
- test
- helpers
- specCases
- unitCases
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18640 | 18640 | | |
18641 | 18641 | | |
18642 | 18642 | | |
| 18643 | + | |
| 18644 | + | |
| 18645 | + | |
| 18646 | + | |
| 18647 | + | |
| 18648 | + | |
| 18649 | + | |
| 18650 | + | |
| 18651 | + | |
| 18652 | + | |
| 18653 | + | |
| 18654 | + | |
| 18655 | + | |
| 18656 | + | |
| 18657 | + | |
| 18658 | + | |
| 18659 | + | |
| 18660 | + | |
| 18661 | + | |
| 18662 | + | |
| 18663 | + | |
| 18664 | + | |
| 18665 | + | |
| 18666 | + | |
| 18667 | + | |
| 18668 | + | |
| 18669 | + | |
| 18670 | + | |
| 18671 | + | |
| 18672 | + | |
| 18673 | + | |
| 18674 | + | |
| 18675 | + | |
| 18676 | + | |
| 18677 | + | |
| 18678 | + | |
| 18679 | + | |
| 18680 | + | |
| 18681 | + | |
| 18682 | + | |
| 18683 | + | |
| 18684 | + | |
| 18685 | + | |
| 18686 | + | |
| 18687 | + | |
| 18688 | + | |
| 18689 | + | |
| 18690 | + | |
| 18691 | + | |
| 18692 | + | |
| 18693 | + | |
| 18694 | + | |
| 18695 | + | |
| 18696 | + | |
| 18697 | + | |
| 18698 | + | |
| 18699 | + | |
| 18700 | + | |
| 18701 | + | |
| 18702 | + | |
| 18703 | + | |
| 18704 | + | |
| 18705 | + | |
18643 | 18706 | | |
18644 | 18707 | | |
18645 | 18708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | | - | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
| |||
573 | 571 | | |
574 | 572 | | |
575 | 573 | | |
576 | | - | |
577 | 574 | | |
578 | 575 | | |
579 | 576 | | |
| |||
596 | 593 | | |
597 | 594 | | |
598 | 595 | | |
599 | | - | |
600 | 596 | | |
601 | 597 | | |
602 | 598 | | |
| |||
655 | 651 | | |
656 | 652 | | |
657 | 653 | | |
| 654 | + | |
658 | 655 | | |
659 | 656 | | |
660 | 657 | | |
| |||
686 | 683 | | |
687 | 684 | | |
688 | 685 | | |
| 686 | + | |
689 | 687 | | |
690 | 688 | | |
691 | 689 | | |
| |||
1339 | 1337 | | |
1340 | 1338 | | |
1341 | 1339 | | |
1342 | | - | |
1343 | 1340 | | |
1344 | 1341 | | |
1345 | 1342 | | |
| |||
1411 | 1408 | | |
1412 | 1409 | | |
1413 | 1410 | | |
1414 | | - | |
1415 | 1411 | | |
1416 | 1412 | | |
1417 | 1413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1601 | 1601 | | |
1602 | 1602 | | |
1603 | 1603 | | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
1604 | 1614 | | |
1605 | 1615 | | |
1606 | 1616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
287 | 292 | | |
288 | 293 | | |
289 | 294 | | |
| |||
642 | 647 | | |
643 | 648 | | |
644 | 649 | | |
645 | | - | |
| 650 | + | |
646 | 651 | | |
647 | 652 | | |
648 | 653 | | |
| |||
710 | 715 | | |
711 | 716 | | |
712 | 717 | | |
| 718 | + | |
713 | 719 | | |
714 | 720 | | |
715 | 721 | | |
| |||
5521 | 5527 | | |
5522 | 5528 | | |
5523 | 5529 | | |
5524 | | - | |
| 5530 | + | |
5525 | 5531 | | |
5526 | 5532 | | |
5527 | 5533 | | |
| |||
0 commit comments