2019-07-16 17:23:04 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
(cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf)
|
|
|
|
|
|
|
|
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
2020-01-09 18:42:53 +00:00
|
|
|
index c37105fa1ed04bd935bc6886606553cffd56a654..4bd467849ccf98ba17e0f4615d1df5febf878173 100644
|
2019-07-16 17:23:04 +00:00
|
|
|
--- a/lib/internal/modules/cjs/loader.js
|
|
|
|
+++ b/lib/internal/modules/cjs/loader.js
|
2020-01-09 18:42:53 +00:00
|
|
|
@@ -1110,8 +1110,8 @@ Module._initPaths = function() {
|
2019-07-16 17:23:04 +00:00
|
|
|
|
|
|
|
modulePaths = paths;
|
|
|
|
|
|
|
|
- // Clone as a shallow copy, for introspection.
|
|
|
|
- Module.globalPaths = modulePaths.slice(0);
|
|
|
|
+ // clone as a shallow copy, for introspection.
|
|
|
|
+ Module.globalPaths = modulePaths;
|
|
|
|
};
|
|
|
|
|
|
|
|
Module._preloadModules = function(requests) {
|