Browse Source

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

v0.7.4-release
Jorge Chamorro Bieling 14 years ago
committed by Ryan Dahl
parent
commit
fd70d30a9c
  1. 3
      src/node.js

3
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();

Loading…
Cancel
Save