Commit e9b68e6
src: move import.meta initializer to native land
When the source text module is compiled without custom callbacks,
instead of calling into JS land from the per-isolate import.meta
initializer and then back to C++ land to set up lazy data
properties, just do the initialization all in C++ land.
Only import.meta.resolve initialization will call back
into JS land to generate a closure that call the cascaded loader
for resolution.
In addition, simplify the loader structure by merging
allowImportMetaResolve into isForAsyncLoaderHookWorker - the two
are essentially equivalent, as import.meta.resolve is only
allowed in a non-loader-hook worker thread's loader.
PR-URL: #60603
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>1 parent d64795b commit e9b68e6Copy full SHA for e9b68e6
File tree
Expand file treeCollapse file tree
9 files changed
+242
-219
lines changedOpen diff view settings
Filter options
- lib/internal/modules
- esm
- src
Expand file treeCollapse file tree
9 files changed
+242
-219
lines changedOpen diff view settings
Collapse file
lib/internal/modules/esm/hooks.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/hooks.js-22Lines changed: 0 additions & 22 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
58 | 58 | |
59 | 59 | |
60 | 60 | |
61 | | - |
62 | 61 | |
63 | 62 | |
64 | 63 | |
| ||
111 | 110 | |
112 | 111 | |
113 | 112 | |
114 | | - |
115 | 113 | |
116 | 114 | |
117 | 115 | |
| ||
163 | 161 | |
164 | 162 | |
165 | 163 | |
166 | | - |
167 | | - |
168 | 164 | |
169 | 165 | |
170 | 166 | |
| ||
480 | 476 | |
481 | 477 | |
482 | 478 | |
483 | | - |
484 | | - |
485 | | - |
486 | | - |
487 | | - |
488 | | - |
489 | 479 | |
490 | 480 | |
491 | 481 | |
| ||
674 | 664 | |
675 | 665 | |
676 | 666 | |
677 | | - |
678 | | - |
679 | | - |
680 | | - |
681 | | - |
682 | | - |
683 | 667 | |
684 | 668 | |
685 | 669 | |
| ||
817 | 801 | |
818 | 802 | |
819 | 803 | |
820 | | - |
821 | | - |
822 | 804 | |
823 | 805 | |
824 | 806 | |
| ||
876 | 858 | |
877 | 859 | |
878 | 860 | |
879 | | - |
880 | | - |
881 | | - |
882 | | - |
883 | 861 | |
884 | 862 | |
885 | 863 | |
|
Collapse file
lib/internal/modules/esm/initialize_import_meta.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/initialize_import_meta.js-83Lines changed: 0 additions & 83 deletions
This file was deleted.
Collapse file
lib/internal/modules/esm/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/loader.js+57-24Lines changed: 57 additions & 24 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
51 | 51 | |
52 | 52 | |
53 | 53 | |
| 54 | + |
54 | 55 | |
55 | 56 | |
56 | 57 | |
| ||
62 | 63 | |
63 | 64 | |
64 | 65 | |
65 | | - |
| 66 | + |
| 67 | + |
66 | 68 | |
67 | 69 | |
68 | 70 | |
| ||
183 | 185 | |
184 | 186 | |
185 | 187 | |
186 | | - |
187 | | - |
188 | | - |
189 | | - |
190 | | - |
191 | | - |
192 | | - |
193 | 188 | |
194 | 189 | |
195 | 190 | |
| ||
200 | 195 | |
201 | 196 | |
202 | 197 | |
203 | | - |
204 | | - |
205 | | - |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
206 | 202 | |
207 | 203 | |
208 | 204 | |
| ||
234 | 230 | |
235 | 231 | |
236 | 232 | |
237 | | - |
238 | 233 | |
239 | 234 | |
240 | | - |
241 | 235 | |
242 | 236 | |
243 | 237 | |
| ||
821 | 815 | |
822 | 816 | |
823 | 817 | |
824 | | - |
825 | | - |
826 | | - |
827 | | - |
828 | | - |
829 | | - |
830 | | - |
831 | | - |
832 | | - |
833 | 818 | |
834 | 819 | |
835 | 820 | |
| ||
883 | 868 | |
884 | 869 | |
885 | 870 | |
886 | | - |
| 871 | + |
| 872 | + |
| 873 | + |
| 874 | + |
| 875 | + |
| 876 | + |
| 877 | + |
| 878 | + |
| 879 | + |
| 880 | + |
| 881 | + |
| 882 | + |
| 883 | + |
| 884 | + |
| 885 | + |
| 886 | + |
| 887 | + |
| 888 | + |
| 889 | + |
| 890 | + |
| 891 | + |
| 892 | + |
| 893 | + |
| 894 | + |
| 895 | + |
| 896 | + |
| 897 | + |
| 898 | + |
| 899 | + |
| 900 | + |
| 901 | + |
| 902 | + |
| 903 | + |
| 904 | + |
| 905 | + |
| 906 | + |
| 907 | + |
| 908 | + |
| 909 | + |
887 | 910 | |
| 911 | + |
888 | 912 | |
889 | 913 | |
890 | 914 | |
| ||
898 | 922 | |
899 | 923 | |
900 | 924 | |
901 | | - |
| 925 | + |
| 926 | + |
| 927 | + |
| 928 | + |
| 929 | + |
| 930 | + |
| 931 | + |
| 932 | + |
| 933 | + |
| 934 | + |
902 | 935 | |
903 | 936 | |
904 | 937 | |
|
Collapse file
lib/internal/modules/esm/utils.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/utils.js+3-16Lines changed: 3 additions & 16 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
183 | 183 | |
184 | 184 | |
185 | 185 | |
186 | | - |
187 | | - |
188 | | - |
189 | | - |
190 | | - |
191 | | - |
192 | | - |
193 | | - |
194 | | - |
195 | | - |
196 | | - |
197 | | - |
| 186 | + |
| 187 | + |
| 188 | + |
198 | 189 | |
199 | 190 | |
200 | 191 | |
201 | 192 | |
202 | 193 | |
203 | | - |
204 | | - |
205 | | - |
206 | | - |
207 | 194 | |
208 | 195 | |
209 | 196 | |
|
Collapse file
lib/internal/modules/package_json_reader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/package_json_reader.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
350 | 350 | |
351 | 351 | |
352 | 352 | |
353 | | - |
| 353 | + |
354 | 354 | |
355 | 355 | |
356 | 356 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
470 | 470 | |
471 | 471 | |
472 | 472 | |
| 473 | + |
473 | 474 | |
474 | 475 | |
475 | 476 | |
|
0 commit comments