Repository navigation
Commit ecfac0e
committed
Emit JS library aliases after non-alias library items
When a JS library alias target (e.g. `foo`) is visited first and
transitively depends on its own alias (e.g. `foo_alias: 'foo'`),
`addedLibraryItems['foo']` is marked as visited before `var _foo = ...`
is emitted. Emitting `var _foo_alias = _foo;` inline during dependency
traversal causes it to appear before `var _foo = ...`, leaving
`_foo_alias` initialized to `undefined` for arrow functions and
non-hoisted values.
Collect JS library alias assignments in `libraryAliases` and emit them
after `libraryItems` (and before `postSets`) so all target symbols are
defined before any alias assignment runs.1 parent 97370e8 commit ecfac0e
3 files changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| |||
728 | 729 | | |
729 | 730 | | |
730 | 731 | | |
| 732 | + | |
731 | 733 | | |
732 | 734 | | |
733 | 735 | | |
734 | 736 | | |
735 | | - | |
| 737 | + | |
736 | 738 | | |
737 | 739 | | |
738 | 740 | | |
| |||
884 | 886 | | |
885 | 887 | | |
886 | 888 | | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
887 | 898 | | |
888 | 899 | | |
889 | 900 | | |
| |||
928 | 939 | | |
929 | 940 | | |
930 | 941 | | |
931 | | - | |
| 942 | + | |
932 | 943 | | |
933 | 944 | | |
934 | 945 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
608 | 616 | | |
609 | 617 | | |
610 | 618 | | |
| |||
0 commit comments