make "node --eval" eval in the global scope.

This commit is contained in:
Jorge Chamorro Bieling authored and Ryan Dahl committed 2010-11-16 10:22:30 -08:00
1 parent b70149856d
commit f76b65755f
1 file changed
+2 -1
+2 -1
View File
@@ -758,7 +758,8 @@ if (process.argv[1]) {
} else if (process._eval) {
// -e, --eval
if (process._eval) console.log(eval(process._eval));
var indirectEval= eval; // so the eval happens in global scope.
if (process._eval) console.log(indirectEval(process._eval));
} else {
// REPL
module.requireNative('repl').start();