From c050d0fa19a2dbb34e1e99403b597a5e8e51b6e5 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sun, 24 Jul 2011 18:04:45 -0700 Subject: [PATCH] Finish removing require.paths Fix require() completion bug in repl, and correct man output --- doc/node.1 | 3 +-- lib/repl.js | 5 +++-- src/node.cc | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/node.1 b/doc/node.1 index 128cbb01d54..60501640660 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -44,8 +44,7 @@ and servers. .SH ENVIRONMENT VARIABLES .IP NODE_PATH -\':\'\-separated list of directories prefixed to the module search path, -require.paths. +\':\'\-separated list of directories prefixed to the module search path. .IP NODE_MODULE_CONTEXTS If set to 1 then modules will load in their own global contexts. diff --git a/lib/repl.js b/lib/repl.js index 09eb2df74c9..09775bf3bdd 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -298,8 +298,9 @@ REPLServer.prototype.complete = function(line) { var filter = match[1]; var dir, files, f, name, base, ext, abs, subfiles, s; group = []; - for (i = 0; i < require.paths.length; i++) { - dir = path.resolve(require.paths[i], subdir); + var paths = module.paths.concat(require("module").globalPaths); + for (i = 0; i < paths.length; i++) { + dir = path.resolve(paths[i], subdir); try { files = fs.readdirSync(dir); } catch (e) { diff --git a/src/node.cc b/src/node.cc index 173bcaa61b9..8ce02183be3 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2259,8 +2259,7 @@ static void PrintHelp() { "\n" "Enviromental variables:\n" "NODE_PATH ':'-separated list of directories\n" - " prefixed to the module search path,\n" - " require.paths.\n" + " prefixed to the module search path.\n" "NODE_MODULE_CONTEXTS Set to 1 to load modules in their own\n" " global contexts.\n" "NODE_DISABLE_COLORS Set to 1 to disable colors in the REPL\n"