0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00

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

This commit is contained in:
Jorge Chamorro Bieling 2010-10-23 22:39:25 +02:00 committed by Ryan Dahl
parent 67652ddf27
commit fd70d30a9c

View File

@ -601,7 +601,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();