repl: use path.resolve() for the module.filename

Windows was seeing: "C:\\path\\to\\cwd/repl"
pull/24503/head
Nathan Rajlich 2012-03-12 17:24:39 -07:00 committed by Bert Belder
parent bcb0cc0b18
commit 109b16d488
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ var context;
exports.disableColors = process.env.NODE_DISABLE_COLORS ? true : false; exports.disableColors = process.env.NODE_DISABLE_COLORS ? true : false;
// hack for require.resolve("./relative") to work properly. // hack for require.resolve("./relative") to work properly.
module.filename = process.cwd() + '/repl'; module.filename = path.resolve('repl');
// hack for repl require to work properly with node_modules folders // hack for repl require to work properly with node_modules folders
module.paths = require('module')._nodeModulePaths(module.filename); module.paths = require('module')._nodeModulePaths(module.filename);