Skip to content

Commit

Permalink
bootstrap: support configure-time user-land snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Oct 24, 2022
1 parent b9945f2 commit 48a1fdc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions patches/node/feat_initialize_asar_support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ Subject: feat: initialize asar support

This patch initializes asar support in Node.js.

diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index 337b95133bc94e395229211c9a00a055b279fcc9..25a8464e4833ff4655db2fe37f4bd482dc147865 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
@@ -94,6 +94,7 @@ function prepareMainThreadExecution(expandArgv1 = false,
diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
index 23d4dbcf6cd8e1e3e4a509672e203323d81e736c..a951a526a1901ec8d83f63df5de8c8f3ed732667 100644
--- a/lib/internal/process/pre_execution.js
+++ b/lib/internal/process/pre_execution.js
@@ -103,12 +103,17 @@ function prepareMainThreadExecution(expandArgv1 = false,
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
loadPreloadModules();
initializeFrozenIntrinsics();
+ setupAsarSupport();
}

function refreshRuntimeOptions() {
@@ -584,6 +585,10 @@ function loadPreloadModules() {
}
refreshOptions();
}

+function setupAsarSupport() {
+ process._linkedBinding('electron_common_asar').initAsarSupport(require);
+}
+
module.exports = {
refreshRuntimeOptions,
patchProcessObject,
function patchProcessObject(expandArgv1) {
const binding = internalBinding('process_methods');
binding.patchProcessObject(process);

0 comments on commit 48a1fdc

Please sign in to comment.