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.
|
|
|
|
|
|
|
|
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
2021-06-17 06:50:56 +00:00
|
|
|
index fbfc17ba6d188537c9fc3dbfb86cae9b708541f7..0390f2a9a2c82f33918407091c086dcc3cbffae1 100644
|
2019-07-16 17:23:04 +00:00
|
|
|
--- a/lib/internal/modules/cjs/loader.js
|
|
|
|
+++ b/lib/internal/modules/cjs/loader.js
|
2021-06-17 06:50:56 +00:00
|
|
|
@@ -1236,7 +1236,7 @@ Module._initPaths = function() {
|
2019-07-16 17:23:04 +00:00
|
|
|
modulePaths = paths;
|
|
|
|
|
2021-06-17 06:50:56 +00:00
|
|
|
// Clone as a shallow copy, for introspection.
|
|
|
|
- Module.globalPaths = ArrayPrototypeSlice(modulePaths);
|
2019-07-16 17:23:04 +00:00
|
|
|
+ Module.globalPaths = modulePaths;
|
|
|
|
};
|
|
|
|
|
|
|
|
Module._preloadModules = function(requests) {
|