electron/patches/node/make_module_globalpaths_a_reference.patch
2021-06-28 18:05:38 +02:00

22 lines
889 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Sun, 14 Apr 2013 15:54:46 +0800
Subject: Make Module.globalPaths a reference.
We need to hack the search paths of the require function so we can
load libraries from embedded applications without modifications of
node's module code.
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index d969a6449cf545c4bb313450dce3940a47be40a2..51bcfe1a4130e5c95f86daad2b2543f9a6fec0a3 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -1222,7 +1222,7 @@ Module._initPaths = function() {
modulePaths = paths;
// Clone as a shallow copy, for introspection.
- Module.globalPaths = ArrayPrototypeSlice(modulePaths);
+ Module.globalPaths = modulePaths;
};
Module._preloadModules = function(requests) {