0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

Remove require.paths from process object

This commit is contained in:
Ryan Dahl 2010-03-15 08:07:33 -07:00
parent 4ccdc501d4
commit 1395cba6ce

View File

@ -461,14 +461,14 @@ function existsSync (path) {
process.paths = [];
var modulePaths = [];
if (process.env["HOME"]) {
process.paths.unshift(path.join(process.env["HOME"], ".node_libraries"));
modulePaths.unshift(path.join(process.env["HOME"], ".node_libraries"));
}
if (process.env["NODE_PATH"]) {
process.paths = process.env["NODE_PATH"].split(":").concat(process.paths);
modulePaths = process.env["NODE_PATH"].split(":").concat(modulePaths);
}
@ -566,7 +566,7 @@ function resolveModulePath(request, parent) {
} else {
id = request;
// debug("ABSOLUTE: id="+id);
paths = process.paths;
paths = modulePaths;
}
return [id, paths];
@ -738,7 +738,7 @@ Module.prototype._compile = function (content, filename) {
return loadModule(path, self);
}
require.paths = process.paths;
require.paths = modulePaths;
require.async = requireAsync;
require.main = process.mainModule;
require.registerExtension = registerExtension;