Repository navigation
Commit 3d161cb
committed
fix(parser): keep require() on the exports object inside a concatenation
Concatenation wrapped the shared external binding, so a CommonJS `require`
in the same group was handed the spec namespace and lost `__esModule`,
which a default-interop helper reads. The same sources built without
concatenation gave it the exports object, so the option's behaviour
depended on whether concatenation ran.
Wrap at the reference instead, where `moduleExportsAccess` already marks a
`require` apart from an import. Costs 3-5 gzip bytes on the cases that
concatenate.1 parent 6e490c2 commit 3d161cb
9 files changed
Lines changed: 84 additions & 64 deletions
File tree
- lib/optimize
- test/configCases/spec-namespace-objects
- concatenated-wrapped
- require-interop
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| |||
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
672 | | - | |
| 673 | + | |
673 | 674 | | |
674 | 675 | | |
675 | 676 | | |
| |||
679 | 680 | | |
680 | 681 | | |
681 | 682 | | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
682 | 697 | | |
683 | 698 | | |
684 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
685 | 702 | | |
686 | 703 | | |
687 | | - | |
| 704 | + | |
688 | 705 | | |
| 706 | + | |
689 | 707 | | |
690 | 708 | | |
691 | 709 | | |
| |||
2730 | 2748 | | |
2731 | 2749 | | |
2732 | 2750 | | |
2733 | | - | |
2734 | | - | |
2735 | | - | |
| 2751 | + | |
2736 | 2752 | | |
2737 | | - | |
2738 | | - | |
2739 | | - | |
2740 | | - | |
2741 | | - | |
2742 | | - | |
2743 | | - | |
2744 | | - | |
2745 | | - | |
2746 | | - | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
2747 | 2756 | | |
2748 | | - | |
2749 | 2757 | | |
2750 | 2758 | | |
2751 | 2759 | | |
| |||
2917 | 2925 | | |
2918 | 2926 | | |
2919 | 2927 | | |
2920 | | - | |
| 2928 | + | |
2921 | 2929 | | |
2922 | | - | |
2923 | | - | |
2924 | | - | |
2925 | | - | |
2926 | | - | |
2927 | | - | |
2928 | | - | |
2929 | | - | |
2930 | | - | |
2931 | | - | |
2932 | | - | |
2933 | | - | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
2934 | 2933 | | |
2935 | | - | |
2936 | 2934 | | |
2937 | 2935 | | |
2938 | 2936 | | |
| |||
3243 | 3241 | | |
3244 | 3242 | | |
3245 | 3243 | | |
| 3244 | + | |
3246 | 3245 | | |
3247 | 3246 | | |
3248 | 3247 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9043 | 9043 | | |
9044 | 9044 | | |
9045 | 9045 | | |
| 9046 | + | |
| 9047 | + | |
| 9048 | + | |
| 9049 | + | |
| 9050 | + | |
9046 | 9051 | | |
9047 | 9052 | | |
9048 | 9053 | | |
| |||
0 commit comments