@@ -10,30 +10,26 @@ its own blended handler between Node and Blink.
10
10
11
11
Not upstreamable.
12
12
13
- diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
14
- index cbfb6e3620a7e77658c86a4730c50661b8a937f7..ccd48027e3dfebd563fcbe83239174c79c693dd7 100644
15
- --- a/lib/internal/process/pre_execution.js
16
- +++ b/lib/internal/process/pre_execution.js
17
- @@ -567,7 +567,7 @@ function initializeESMLoader() {
18
- // Create this WeakMap in js-land because V8 has no C++ API for WeakMap.
19
- internalBinding('module_wrap').callbackMap = new SafeWeakMap();
20
-
21
- - if (getEmbedderOptions().shouldNotRegisterESMLoader) return;
13
+ diff --git a/lib/internal/modules/esm/utils.js b/lib/internal/modules/esm/utils.js
14
+ index 985784383024450833a8324d45a7af2fe214a09c..524558b6d00969c2b62cd6050fde9de583f14e90 100644
15
+ --- a/lib/internal/modules/esm/utils.js
16
+ +++ b/lib/internal/modules/esm/utils.js
17
+ @@ -148,12 +148,13 @@ async function importModuleDynamicallyCallback(symbol, specifier, assertions) {
18
+ // the loader worker in internal/main/worker_thread.js.
19
+ let _isLoaderWorker = false;
20
+ function initializeESM(isLoaderWorker = false) {
22
21
+ const shouldSetOnIsolate = !getEmbedderOptions().shouldNotRegisterESMLoader;
23
-
24
- const {
25
- setImportModuleDynamicallyCallback,
26
- @@ -576,8 +576,8 @@ function initializeESMLoader() {
27
- const esm = require('internal/process/esm_loader');
22
+ _isLoaderWorker = isLoaderWorker;
23
+ initializeDefaultConditions();
28
24
// Setup per-isolate callbacks that locate data or callbacks that we keep
29
25
// track of for different ESM modules.
30
- - setInitializeImportMetaObjectCallback(esm.initializeImportMetaObject);
31
- - setImportModuleDynamicallyCallback(esm.importModuleDynamicallyCallback);
32
- + setInitializeImportMetaObjectCallback(esm.initializeImportMetaObject, shouldSetOnIsolate);
33
- + setImportModuleDynamicallyCallback(esm.importModuleDynamicallyCallback, shouldSetOnIsolate);
26
+ - setInitializeImportMetaObjectCallback(initializeImportMetaObject);
27
+ - setImportModuleDynamicallyCallback(importModuleDynamicallyCallback);
28
+ + setInitializeImportMetaObjectCallback(initializeImportMetaObject, shouldSetOnIsolate);
29
+ + setImportModuleDynamicallyCallback(importModuleDynamicallyCallback, shouldSetOnIsolate);
30
+ }
34
31
35
- // Patch the vm module when --experimental-vm-modules is on.
36
- // Please update the comments in vm.js when this block changes.
32
+ function isLoaderWorker() {
37
33
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
38
34
index 0645b3ddf506df2a76f5661f0ec6bb35d5d8b94e..e0f1b2d51f3055b2250f2c0dc1dfd1048b645dd9 100644
39
35
--- a/src/module_wrap.cc
@@ -82,11 +78,11 @@ index 0645b3ddf506df2a76f5661f0ec6bb35d5d8b94e..e0f1b2d51f3055b2250f2c0dc1dfd104
82
78
83
79
MaybeLocal<Value> ModuleWrap::SyntheticModuleEvaluationStepsCallback(
84
80
diff --git a/src/module_wrap.h b/src/module_wrap.h
85
- index 58b233d036515c52d9bd5574c776c2ea65d2ecb1..5f7ef75480a76761c6fa62061c8700c812a3fc6f 100644
81
+ index 6435bad40936fe235822c0597310b94ab98082f3..c51eb99ce3eb54bc30ae922e0357b637b09d53c6 100644
86
82
--- a/src/module_wrap.h
87
83
+++ b/src/module_wrap.h
88
84
@@ -30,7 +30,14 @@ enum HostDefinedOptions : int {
89
- kLength = 10 ,
85
+ kLength = 9 ,
90
86
};
91
87
92
88
- class ModuleWrap : public BaseObject {
@@ -100,4 +96,4 @@ index 58b233d036515c52d9bd5574c776c2ea65d2ecb1..5f7ef75480a76761c6fa62061c8700c8
100
96
+ class NODE_EXTERN ModuleWrap : public BaseObject {
101
97
public:
102
98
enum InternalFields {
103
- kModuleWrapBaseField = BaseObject::kInternalFieldCount,
99
+ kModuleSlot = BaseObject::kInternalFieldCount,
0 commit comments