From fd70d30a9cde6ddb46487035e57075e2ace19f15 Mon Sep 17 00:00:00 2001 From: Jorge Chamorro Bieling Date: Sat, 23 Oct 2010 22:39:25 +0200 Subject: [PATCH] make "node --eval" eval in the global scope. --- src/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node.js b/src/node.js index 8ebe7b14d8c..678e1362810 100644 --- a/src/node.js +++ b/src/node.js @@ -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();