summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-10-15 23:36:56 -0400
committercjihrig <cjihrig@gmail.com>2018-12-11 00:53:02 -0500
commit60ce2fd827e4f6e4a8a4f39816f93b3043ec92e1 (patch)
treee23b06b2bf5bb6d9f631bd3952952721f91f86d1 /lib
parent083b31d850aaee53d877162b15aaa317ae8d9f39 (diff)
downloadandroid-node-v8-60ce2fd827e4f6e4a8a4f39816f93b3043ec92e1.tar.gz
android-node-v8-60ce2fd827e4f6e4a8a4f39816f93b3043ec92e1.tar.bz2
android-node-v8-60ce2fd827e4f6e4a8a4f39816f93b3043ec92e1.zip
module: don't search in require.resolve.paths
The paths used by require.resolve() should be treated as starting points for module resolution, and not actually searched. PR-URL: https://github.com/nodejs/node/pull/23683 Fixes: https://github.com/nodejs/node/issues/18408 Refs: https://github.com/nodejs/node/issues/23643 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/modules/cjs/loader.js3
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 0fbb3b5cf3..91d32ea2d0 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -584,9 +584,6 @@ Module._resolveFilename = function(request, parent, isMain, options) {
fakeParent.paths = Module._nodeModulePaths(path);
const lookupPaths = Module._resolveLookupPaths(request, fakeParent, true);
- if (!paths.includes(path))
- paths.push(path);
-
for (var j = 0; j < lookupPaths.length; j++) {
if (!paths.includes(lookupPaths[j]))
paths.push(lookupPaths[j]);