Commit fb2db5f
src: support import() and import.meta in embedder-run modules
This adds a embedder_module_hdo for identifying embedder-run
modules in the dynamic import handler and import.meta initializer,
and a SourceTextModuleTypes for customizing source text module
compilation in the JS land via compileSourceTextModule().
Also, refactors the existing embedder module compilation code
to reuse the builtin resolution logic.
PR-URL: #61654
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Aditi Singh <aditisingh1400@gmail.com>1 parent 4f2f800 commit fb2db5fCopy full SHA for fb2db5f
10 files changed
+320-76Lines changed: 320 additions & 76 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib/internal
- main
- modules
- esm
- src
- test/cctest
Expand file treeCollapse file tree
Open diff view settings
Collapse file
lib/internal/main/embedding.js
Copy file name to clipboardExpand all lines: lib/internal/main/embedding.js+8-53Lines changed: 8 additions & 53 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | | - |
19 | | - |
20 | 18 | |
21 | 19 | |
22 | 20 | |
23 | | - |
24 | | - |
25 | | - |
26 | 21 | |
27 | | - |
| 22 | + |
| 23 | + |
28 | 24 | |
29 | 25 | |
30 | 26 | |
| ||
34 | 30 | |
35 | 31 | |
36 | 32 | |
37 | | - |
38 | 33 | |
39 | 34 | |
40 | 35 | |
| ||
65 | 60 | |
66 | 61 | |
67 | 62 | |
| 63 | + |
68 | 64 | |
69 | 65 | |
70 | 66 | |
| ||
103 | 99 | |
104 | 100 | |
105 | 101 | |
106 | | - |
107 | | - |
108 | | - |
109 | | - |
110 | | - |
111 | | - |
112 | | - |
113 | | - |
114 | | - |
115 | | - |
116 | | - |
117 | | - |
118 | | - |
119 | | - |
120 | 102 | |
121 | | - |
122 | | - |
123 | | - |
124 | | - |
125 | | - |
126 | | - |
127 | | - |
| 103 | + |
128 | 104 | |
129 | 105 | |
130 | 106 | |
| ||
134 | 110 | |
135 | 111 | |
136 | 112 | |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | | - |
144 | | - |
145 | | - |
146 | | - |
147 | | - |
148 | | - |
149 | | - |
150 | | - |
151 | | - |
152 | | - |
153 | | - |
154 | | - |
155 | | - |
156 | | - |
157 | | - |
158 | | - |
159 | | - |
160 | | - |
161 | | - |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
162 | 117 | |
163 | 118 | |
164 | 119 | |
|
Collapse file
lib/internal/modules/esm/create_dynamic_module.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/create_dynamic_module.js+4-2Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
58 | 58 | |
59 | 59 | |
60 | 60 | |
61 | | - |
62 | | - |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
63 | 65 | |
64 | 66 | |
65 | 67 | |
|
Collapse file
lib/internal/modules/esm/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/loader.js+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
34 | 34 | |
35 | 35 | |
36 | 36 | |
| 37 | + |
37 | 38 | |
38 | 39 | |
39 | 40 | |
| ||
244 | 245 | |
245 | 246 | |
246 | 247 | |
247 | | - |
| 248 | + |
248 | 249 | |
249 | 250 | |
250 | 251 | |
| ||
371 | 372 | |
372 | 373 | |
373 | 374 | |
374 | | - |
| 375 | + |
375 | 376 | |
376 | 377 | |
377 | 378 | |
|
Collapse file
lib/internal/modules/esm/translators.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/translators.js+4-2Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
93 | 93 | |
94 | 94 | |
95 | 95 | |
96 | | - |
| 96 | + |
| 97 | + |
| 98 | + |
97 | 99 | |
98 | | - |
| 100 | + |
99 | 101 | |
100 | 102 | |
101 | 103 | |
|
Collapse file
lib/internal/modules/esm/utils.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/utils.js+66-7Lines changed: 66 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
| 17 | + |
17 | 18 | |
18 | 19 | |
19 | 20 | |
| ||
43 | 44 | |
44 | 45 | |
45 | 46 | |
| 47 | + |
46 | 48 | |
47 | 49 | |
48 | 50 | |
| ||
226 | 228 | |
227 | 229 | |
228 | 230 | |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
229 | 253 | |
230 | 254 | |
231 | 255 | |
| ||
253 | 277 | |
254 | 278 | |
255 | 279 | |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | + |
256 | 284 | |
257 | 285 | |
258 | 286 | |
| ||
290 | 318 | |
291 | 319 | |
292 | 320 | |
| 321 | + |
| 322 | + |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | + |
293 | 328 | |
294 | 329 | |
295 | 330 | |
296 | 331 | |
297 | 332 | |
298 | | - |
299 | | - |
| 333 | + |
300 | 334 | |
301 | 335 | |
302 | 336 | |
303 | | - |
304 | | - |
305 | | - |
| 337 | + |
| 338 | + |
| 339 | + |
| 340 | + |
| 341 | + |
| 342 | + |
| 343 | + |
| 344 | + |
| 345 | + |
| 346 | + |
| 347 | + |
| 348 | + |
| 349 | + |
| 350 | + |
| 351 | + |
| 352 | + |
| 353 | + |
| 354 | + |
306 | 355 | |
307 | | - |
| 356 | + |
308 | 357 | |
309 | 358 | |
310 | 359 | |
| ||
317 | 366 | |
318 | 367 | |
319 | 368 | |
| 369 | + |
| 370 | + |
| 371 | + |
| 372 | + |
| 373 | + |
| 374 | + |
| 375 | + |
| 376 | + |
| 377 | + |
320 | 378 | |
321 | 379 | |
322 | 380 | |
323 | | - |
324 | 381 | |
325 | 382 | |
326 | 383 | |
| ||
331 | 388 | |
332 | 389 | |
333 | 390 | |
| 391 | + |
334 | 392 | |
335 | 393 | |
336 | 394 | |
337 | 395 | |
338 | 396 | |
339 | 397 | |
| 398 | + |
340 | 399 | |
341 | 400 | |
Collapse file
lib/internal/modules/helpers.js
Copy file name to clipboardExpand all lines: lib/internal/modules/helpers.js+39Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
| 18 | + |
18 | 19 | |
19 | 20 | |
20 | 21 | |
| ||
28 | 29 | |
29 | 30 | |
30 | 31 | |
| 32 | + |
31 | 33 | |
32 | 34 | |
33 | 35 | |
| ||
126 | 128 | |
127 | 129 | |
128 | 130 | |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | + |
129 | 167 | |
130 | 168 | |
131 | 169 | |
| ||
469 | 507 | |
470 | 508 | |
471 | 509 | |
| 510 | + |
472 | 511 | |
473 | 512 | |
474 | 513 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
58 | 58 | |
59 | 59 | |
60 | 60 | |
| 61 | + |
61 | 62 | |
62 | 63 | |
63 | 64 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1397 | 1397 | |
1398 | 1398 | |
1399 | 1399 | |
1400 | | - |
| 1400 | + |
| 1401 | + |
1401 | 1402 | |
1402 | 1403 | |
1403 | 1404 | |
|
0 commit comments