2019-07-16 17:23:04 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Shelley Vohr <shelley.vohr@gmail.com>
|
|
|
|
Date: Thu, 13 Sep 2018 08:56:07 -0700
|
|
|
|
Subject: feat: initialize asar support
|
|
|
|
|
2019-10-14 22:46:10 +00:00
|
|
|
This patch initializies asar support in Node.js.
|
2019-07-16 17:23:04 +00:00
|
|
|
|
|
|
|
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
|
2019-12-11 00:22:35 +00:00
|
|
|
index 0cad5209c4ff4e68d7c400af1d2b4c234210ddb4..918bc8c0c4e78bad5a3372e8a5522da00aa9073e 100644
|
2019-07-16 17:23:04 +00:00
|
|
|
--- a/lib/internal/bootstrap/loaders.js
|
|
|
|
+++ b/lib/internal/bootstrap/loaders.js
|
2019-12-11 00:22:35 +00:00
|
|
|
@@ -192,6 +192,8 @@ function nativeModuleRequire(id) {
|
2019-07-16 17:23:04 +00:00
|
|
|
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
|
2019-12-11 00:22:35 +00:00
|
|
|
index f959310156141623c2acc9e4d8bdad433d401925..113d2e58a9cecf233bf6a60138cdfc60f338b28c 100644
|
2019-07-16 17:23:04 +00:00
|
|
|
--- a/lib/internal/bootstrap/pre_execution.js
|
|
|
|
+++ b/lib/internal/bootstrap/pre_execution.js
|
2019-12-11 00:22:35 +00:00
|
|
|
@@ -61,6 +61,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
2019-07-16 17:23:04 +00:00
|
|
|
initializeESMLoader();
|
|
|
|
loadPreloadModules();
|
2019-10-14 22:46:10 +00:00
|
|
|
initializeFrozenIntrinsics();
|
2019-07-16 17:23:04 +00:00
|
|
|
+ setupAsarSupport();
|
|
|
|
}
|
|
|
|
|
|
|
|
function patchProcessObject(expandArgv1) {
|
2019-12-11 00:22:35 +00:00
|
|
|
@@ -444,6 +445,10 @@ function loadPreloadModules() {
|
2019-07-16 17:23:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+function setupAsarSupport() {
|
|
|
|
+ process._linkedBinding('atom_common_asar').initAsarSupport(require);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
module.exports = {
|
|
|
|
patchProcessObject,
|
|
|
|
setupCoverageHooks,
|