mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
make "node --eval" eval in the global scope.
This commit is contained in:
1 parent
b70149856d
commit
f76b65755f
1 file changed
+2
-1
+2
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user