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

This is for scripts being fed from stdin:

  $ echo "{ foo: 'bar' }" | node -p
pull/24503/head
Nathan Rajlich 2012-04-24 01:24:13 -07:00
parent 0b5235e68c
commit ef3a874f41
1 changed files with 5 additions and 1 deletions

View File

@ -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) {