Skip to content

Commit

Permalink
Fixup asar support setup patch
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Feb 21, 2020
1 parent 7f75f36 commit 55bb778
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions patches/node/feat_initialize_asar_support.patch
Expand Up @@ -3,34 +3,21 @@ From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 13 Sep 2018 08:56:07 -0700
Subject: feat: initialize asar support

This patch initializies asar support in Node.js.
This patch initializes asar support in Node.js.

diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
index 0cad5209c4ff4e68d7c400af1d2b4c234210ddb4..918bc8c0c4e78bad5a3372e8a5522da00aa9073e 100644
--- a/lib/internal/bootstrap/loaders.js
+++ b/lib/internal/bootstrap/loaders.js
@@ -192,6 +192,8 @@ function nativeModuleRequire(id) {
return mod.compile();
}

+NativeModule.require = nativeModuleRequire
+
NativeModule.exists = function(id) {
return NativeModule.map.has(id);
};
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index 2aa2a3b46c5fc12d22e0e74e304d2d55ca02c3b5..c86b5851ca9332ca440443e5feab2e65c7ac30b9 100644
index 1b05d6e30a0ba004ac3c1113da3ad649a6e74dcc..2fc1151251571db91e01725353af2c8ff41af018 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
@@ -61,6 +61,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
initializeESMLoader();
@@ -67,6 +67,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
loadPreloadModules();
initializeFrozenIntrinsics();
+ setupAsarSupport();
}

function patchProcessObject(expandArgv1) {
@@ -444,6 +445,10 @@ function loadPreloadModules() {
@@ -445,6 +446,10 @@ function loadPreloadModules() {
}
}

Expand Down

0 comments on commit 55bb778

Please sign in to comment.