Skip to content

Commit 7f0b169

Browse files
committed
Fixup asar support setup patch
nodejs/node#30862
1 parent 79617ed commit 7f0b169

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

patches/node/feat_initialize_asar_support.patch

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,21 @@ From: Shelley Vohr <shelley.vohr@gmail.com>
33
Date: Thu, 13 Sep 2018 08:56:07 -0700
44
Subject: feat: initialize asar support
55

6-
This patch initializies asar support in Node.js.
6+
This patch initializes asar support in Node.js.
77

8-
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
9-
index 0cad5209c4ff4e68d7c400af1d2b4c234210ddb4..918bc8c0c4e78bad5a3372e8a5522da00aa9073e 100644
10-
--- a/lib/internal/bootstrap/loaders.js
11-
+++ b/lib/internal/bootstrap/loaders.js
12-
@@ -192,6 +192,8 @@ function nativeModuleRequire(id) {
13-
return mod.compile();
14-
}
15-
16-
+NativeModule.require = nativeModuleRequire
17-
+
18-
NativeModule.exists = function(id) {
19-
return NativeModule.map.has(id);
20-
};
218
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
22-
index 2aa2a3b46c5fc12d22e0e74e304d2d55ca02c3b5..c86b5851ca9332ca440443e5feab2e65c7ac30b9 100644
9+
index 1b05d6e30a0ba004ac3c1113da3ad649a6e74dcc..2fc1151251571db91e01725353af2c8ff41af018 100644
2310
--- a/lib/internal/bootstrap/pre_execution.js
2411
+++ b/lib/internal/bootstrap/pre_execution.js
25-
@@ -61,6 +61,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
26-
initializeESMLoader();
12+
@@ -67,6 +67,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
13+
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
2714
loadPreloadModules();
2815
initializeFrozenIntrinsics();
2916
+ setupAsarSupport();
3017
}
3118

3219
function patchProcessObject(expandArgv1) {
33-
@@ -444,6 +445,10 @@ function loadPreloadModules() {
20+
@@ -445,6 +446,10 @@ function loadPreloadModules() {
3421
}
3522
}
3623

0 commit comments

Comments
 (0)