Commit d55c3e7
esm: link modules synchronously when no async loader hooks are used
When no async loader hooks are registered, perform the linking as
synchronously as possible to reduce the chance of races from the
the shared module loading cache.
PR-URL: #59519
Fixes: #59366
Refs: https://github.com/abejfehr/node-22.18-issue-repro
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>1 parent 9e1fbb6 commit d55c3e7Copy full SHA for d55c3e7
File tree
Expand file treeCollapse file tree
5 files changed
+25
-15
lines changedOpen diff view settings
Filter options
- lib/internal/modules/esm
- test/es-module
Expand file treeCollapse file tree
5 files changed
+25
-15
lines changedOpen diff view settings
Collapse file
lib/internal/modules/esm/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/loader.js+13-5Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
63 | 63 | |
64 | 64 | |
65 | 65 | |
| 66 | + |
| 67 | + |
66 | 68 | |
67 | 69 | |
68 | 70 | |
| ||
582 | 584 | |
583 | 585 | |
584 | 586 | |
585 | | - |
| 587 | + |
586 | 588 | |
587 | 589 | |
588 | 590 | |
589 | | - |
| 591 | + |
590 | 592 | |
591 | | - |
592 | | - |
593 | | - |
| 593 | + |
| 594 | + |
| 595 | + |
| 596 | + |
| 597 | + |
| 598 | + |
| 599 | + |
| 600 | + |
| 601 | + |
594 | 602 | |
595 | 603 | |
596 | 604 | |
|
Collapse file
lib/internal/modules/esm/module_job.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/module_job.js+5-5Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
37 | 37 | |
38 | 38 | |
39 | 39 | |
| 40 | + |
40 | 41 | |
41 | 42 | |
42 | 43 | |
| ||
135 | 136 | |
136 | 137 | |
137 | 138 | |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
| 139 | + |
143 | 140 | |
| 141 | + |
| 142 | + |
| 143 | + |
144 | 144 | |
145 | 145 | |
146 | 146 | |
|
Collapse file
test/es-module/test-esm-error-cache.js
Copy file name to clipboardExpand all lines: test/es-module/test-esm-error-cache.js+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
19 | 19 | |
20 | 20 | |
21 | 21 | |
22 | | - |
| 22 | + |
| 23 | + |
| 24 | + |
23 | 25 | |
24 | 26 | |
25 | 27 | |
|
Collapse file
test/es-module/test-esm-import-attributes-errors.js
Copy file name to clipboardExpand all lines: test/es-module/test-esm-import-attributes-errors.js+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
28 | 28 | |
29 | 29 | |
30 | 30 | |
31 | | - |
| 31 | + |
32 | 32 | |
33 | 33 | |
34 | 34 | |
| ||
48 | 48 | |
49 | 49 | |
50 | 50 | |
51 | | - |
| 51 | + |
52 | 52 | |
53 | 53 | |
54 | 54 | |
|
Collapse file
test/es-module/test-esm-import-attributes-errors.mjs
Copy file name to clipboardExpand all lines: test/es-module/test-esm-import-attributes-errors.mjs+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
| 26 | + |
27 | 27 | |
28 | 28 | |
29 | 29 | |
| ||
43 | 43 | |
44 | 44 | |
45 | 45 | |
46 | | - |
| 46 | + |
47 | 47 | |
48 | 48 | |
49 | 49 | |
|
0 commit comments