Repository navigation
Commit c3e22dc
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 c3e22dc
3 files changed
Lines changed: 19 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 | + | |
887 | 893 | | |
888 | 894 | | |
889 | 895 | | |
| |||
928 | 934 | | |
929 | 935 | | |
930 | 936 | | |
931 | | - | |
| 937 | + | |
932 | 938 | | |
933 | 939 | | |
934 | 940 | | |
| |||
| 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