From 95d530f2b4faa57662d3b052e7637246b6a7025f Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Wed, 19 Oct 2011 13:46:06 -0700 Subject: [PATCH] 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. --- lib/repl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/repl.js b/lib/repl.js index 0ac6bc5217df..3feb651fa85e 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -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'); }