Emacs lisp command calling node hello.js
:
(call-process "node" nil t nil "hello.js")
Two variants of hello.js
:
hello_1.js
:console.log('Hello world!');
Output:
Hello world! 0
hello_2.js
:console.log('Hello world!'); process.exit(5);
Output (no output from log statement!):
5
What is the reason that process.exit(5)
causes output to be suppressed?
Notes:
I experienced the problem in GNU Emacs 24.3.1 (i386-mingw-nt5.1.2600) of 2013-03-17 on MARVIN in combination with Node.js v0.10.18, running on Windows XP/SP3/32.
I tried EShell to execute the node command line: no output
process.exit()
calls low levelprocess.reallyExit()
, which causes the problem: no outputprocess.reallyExit()
is implemented in C++:void Exit(const FunctionCallbackInfo<Value>& args) { HandleScope scope(node_isolate); exit(args[0]->IntegerValue()); }
[...]
NODE_SET_METHOD(process, "reallyExit", Exit);