Browse Source

process: set _print_eval even when --eval is not passed

This is for scripts being fed from stdin:

  $ echo "{ foo: 'bar' }" | node -p
v0.9.1-release
Nathan Rajlich 13 years ago
parent
commit
ef3a874f41
  1. 6
      src/node.cc

6
src/node.cc

@ -2209,7 +2209,11 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
// -e, --eval
if (eval_string) {
process->Set(String::NewSymbol("_eval"), String::New(eval_string));
process->Set(String::NewSymbol("_print_eval"), Boolean::New(print_eval));
}
// -p, --print
if (print_eval) {
process->Set(String::NewSymbol("_print_eval"), True());
}
if (force_repl) {

Loading…
Cancel
Save