summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-10-19 12:01:22 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-10-20 15:22:02 -0700
commitbfc6b51d955089a7e5b23807b4722cdaec0a8e0b (patch)
treedf8d704c3fc51086f32ba240bbc74ac9408e686f /lib
parent492fc0d7524c0a5b546fb1a16f1b49bb4db73da8 (diff)
downloadnodejs-bfc6b51d955089a7e5b23807b4722cdaec0a8e0b.tar.gz
nodejs-bfc6b51d955089a7e5b23807b4722cdaec0a8e0b.tar.bz2
nodejs-bfc6b51d955089a7e5b23807b4722cdaec0a8e0b.zip
The cwdRequire hack is no longer necessary with the require.resolve refactor.
Diffstat (limited to 'lib')
-rw-r--r--lib/repl.js11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/repl.js b/lib/repl.js
index 91a38d49e..668e7a0d0 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -22,15 +22,6 @@ var context;
var disableColors = process.env.NODE_DISABLE_COLORS ? true : false;
-function cwdRequire (id) {
- if (id.match(/^\.\.\//) || id.match(/^\.\//)) {
- id = path.join(process.cwd(), id);
- }
- return require(id);
-}
-Object.keys(require).forEach(function (k) {
- cwdRequire[k] = require[k];
-});
// hack for require.resolve("./relative") to work properly.
module.filename = process.cwd() + "/repl";
@@ -38,7 +29,7 @@ function resetContext() {
context = Script.createContext();
for (var i in global) context[i] = global[i];
context.module = module;
- context.require = cwdRequire;
+ context.require = require;
}