Skip to content

Commit 05eb244

Browse files
committed
module: refactor to use more primordials
nodejs/node#36024
1 parent 4b267a6 commit 05eb244

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

patches/node/make_module_globalpaths_a_reference.patch

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,15 @@ We need to hack the search paths of the require function so we can
77
load libraries from embedded applications without modifications of
88
node's module code.
99

10-
(cherry picked from commit 76ba048c37588ee32636817fa7b8dffc64330cbf)
11-
1210
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
13-
index ebe0c741c9e177fe99631643030f97e8545c3368..82c08cd17b33c14b85e6586269b5dc4b233fd9e6 100644
11+
index fbfc17ba6d188537c9fc3dbfb86cae9b708541f7..0390f2a9a2c82f33918407091c086dcc3cbffae1 100644
1412
--- a/lib/internal/modules/cjs/loader.js
1513
+++ b/lib/internal/modules/cjs/loader.js
16-
@@ -1199,8 +1199,8 @@ Module._initPaths = function() {
17-
14+
@@ -1236,7 +1236,7 @@ Module._initPaths = function() {
1815
modulePaths = paths;
1916

20-
- // Clone as a shallow copy, for introspection.
21-
- Module.globalPaths = modulePaths.slice(0);
22-
+ // clone as a shallow copy, for introspection.
17+
// Clone as a shallow copy, for introspection.
18+
- Module.globalPaths = ArrayPrototypeSlice(modulePaths);
2319
+ Module.globalPaths = modulePaths;
2420
};
2521

0 commit comments

Comments
 (0)