projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b5235e
)
process: set _print_eval even when --eval is not passed
author
Nathan Rajlich
<nathan@tootallnate.net>
Tue, 24 Apr 2012 08:24:13 +0000
(
01:24
-0700)
committer
Nathan Rajlich
<nathan@tootallnate.net>
Tue, 24 Apr 2012 18:31:02 +0000
(11:31 -0700)
This is for scripts being fed from stdin:
$ echo "{ foo: 'bar' }" | node -p
src/node.cc
patch
|
blob
|
history
diff --git
a/src/node.cc
b/src/node.cc
index
7bfcdb8
..
714dd4c
100644
(file)
--- a/
src/node.cc
+++ b/
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) {