Skip to content

Commit ff50050

Browse files
committed
module: handle null source from async loader hooks in sync hooks
nodejs/node#59929
1 parent 5f85b84 commit ff50050

3 files changed

Lines changed: 4 additions & 4 deletions

patches/node/fix_do_not_resolve_electron_entrypoints.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Subject: fix: do not resolve electron entrypoints
66
This wastes fs cycles and can result in strange behavior if this path actually exists on disk
77

88
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
9-
index e287401f585f687f34f04b61aa5487e3fcb27b1c..f83339c5fbe37a2d735b77b3083d55ff22f55ca9 100644
9+
index 96869be3c48b84106a5fe2cb752fe979a211d96a..64f8902b1a3d5c335a3b8889b2dc801e8f9ec79c 100644
1010
--- a/lib/internal/modules/esm/translators.js
1111
+++ b/lib/internal/modules/esm/translators.js
1212
@@ -404,6 +404,10 @@ function cjsPreparseModuleExports(filename, source, format) {

patches/node/fix_expose_the_built-in_electron_module_via_the_esm_loader.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ index c27ee4c6612c6a7ea0b6355f03563e8724fd0e40..5f03cf14e948d449d303b22ab6710b55
103103

104104
const packageConfig = packageJsonReader.read(packageJSONPath, { __proto__: null, specifier, base, isESM: true });
105105
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
106-
index 446349113e13bce042734010fd98af053c8cf31e..f2fff52c4a75d827be9f2545703c9de3f9e0941f 100644
106+
index 446349113e13bce042734010fd98af053c8cf31e..52b8b5d9255f782af96aa859dec4ffa6ca82c9d0 100644
107107
--- a/lib/internal/modules/esm/translators.js
108108
+++ b/lib/internal/modules/esm/translators.js
109109
@@ -220,7 +220,9 @@ function createCJSModuleWrap(url, translateContext, parentURL, loadCJS = loadCJS
@@ -122,7 +122,7 @@ index 446349113e13bce042734010fd98af053c8cf31e..f2fff52c4a75d827be9f2545703c9de3
122122
});
123123

124124
+translators.set('electron', () => {
125-
+ return createCJSModuleWrap('electron', '');
125+
+ return createCJSModuleWrap('electron', { source: '' });
126126
+});
127127
+
128128
// Handle CommonJS modules referenced by `require` calls.

patches/node/fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ index 5f03cf14e948d449d303b22ab6710b5508fb83b2..72cc9444ca93ef7a1526e23314693aea
5050
});
5151
const { search, hash } = resolved;
5252
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
53-
index f2fff52c4a75d827be9f2545703c9de3f9e0941f..e287401f585f687f34f04b61aa5487e3fcb27b1c 100644
53+
index 52b8b5d9255f782af96aa859dec4ffa6ca82c9d0..96869be3c48b84106a5fe2cb752fe979a211d96a 100644
5454
--- a/lib/internal/modules/esm/translators.js
5555
+++ b/lib/internal/modules/esm/translators.js
5656
@@ -24,7 +24,7 @@ const {

0 commit comments

Comments
 (0)