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
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
|
2019-08-13 00:29:34 +00:00
|
|
|
index 2889df4812bb031f1a0debe1eb0b75bd6c846407..0b3b92b33490fe754788a94dedce7533de528acf 100644
|
2019-07-16 17:23:04 +00:00
|
|
|
--- a/lib/internal/bootstrap/loaders.js
|
|
|
|
+++ b/lib/internal/bootstrap/loaders.js
|
|
|
|
@@ -189,6 +189,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
|
2019-08-13 00:29:34 +00:00
|
|
|
index 104ebaff320573f3f517d0839eef66a186080da9..072e614fca05197fb2b259914711033981f6e2f2 100644
|
2019-07-16 17:23:04 +00:00
|
|
|
--- a/lib/internal/bootstrap/pre_execution.js
|
|
|
|
+++ b/lib/internal/bootstrap/pre_execution.js
|
2019-08-13 00:29:34 +00:00
|
|
|
@@ -52,6 +52,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
2019-07-16 17:23:04 +00:00
|
|
|
initializeCJSLoader();
|
|
|
|
initializeESMLoader();
|
|
|
|
loadPreloadModules();
|
|
|
|
+ setupAsarSupport();
|
|
|
|
}
|
|
|
|
|
|
|
|
function patchProcessObject(expandArgv1) {
|
2019-08-13 00:29:34 +00:00
|
|
|
@@ -420,6 +421,10 @@ function loadPreloadModules() {
|
2019-07-16 17:23:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+function setupAsarSupport() {
|
|
|
|
+ process._linkedBinding('atom_common_asar').initAsarSupport(require);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
module.exports = {
|
|
|
|
patchProcessObject,
|
|
|
|
setupCoverageHooks,
|