0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00

repl: print out undefined

util.inspect() has a special case for "undefined", so it's nice to be able to
distinguish visually that undefined is the result of an expression.
This commit is contained in:
Nathan Rajlich 2011-10-19 13:46:06 -07:00 committed by Ben Noordhuis
parent b43eb9678b
commit 95d530f2b4

View File

@ -228,7 +228,7 @@ function REPLServer(prompt, stream, eval) {
self.bufferedCommand = '';
// If we got any output - print it (if no error)
if (!e && ret !== undefined) {
if (!e) {
global._ = ret;
self.outputStream.write(exports.writer(ret) + '\n');
}