From c9df7be3a1b7308c5ba542325e728f546eab0f23 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 14 Apr 2013 15:54:46 +0800 Subject: [PATCH] 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) --- lib/internal/modules/cjs/loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index c218dc2cac2..2fe3f9e3158 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -783,7 +783,7 @@ Module._initPaths = function() { modulePaths = paths; // clone as a shallow copy, for introspection. - Module.globalPaths = modulePaths.slice(0); + Module.globalPaths = modulePaths; }; Module._preloadModules = function(requests) {