Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fix require with --eval
Browse files Browse the repository at this point in the history
Caused by bad merging of d6ec8f

Fixes #1261.
  • Loading branch information
ry committed Jul 3, 2011
1 parent 69d20f5 commit 44d30f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@
} else if (process._eval != null) {
// User passed '-e' or '--eval' arguments to Node.
var Module = NativeModule.require('module');
var rv = new Module()._compile('return eval(process._eval)', 'eval');
var path = NativeModule.require('path');
var cwd = process.cwd();

var module = new Module('eval');
module.filename = path.join(cwd, 'eval');
module.paths = Module._nodeModulePaths(cwd);
var rv = module._compile('return eval(process._eval)', 'eval');
console.log(rv);

} else {
Expand Down

0 comments on commit 44d30f2

Please sign in to comment.