Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Print out undefined on the REPL when returned.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TooTallNate authored and koichik committed Oct 22, 2011
1 parent 7e2d799 commit bdb9d09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/repl.js
Expand Up @@ -224,7 +224,7 @@ function REPLServer(prompt, stream, eval, useGlobal) {
self.bufferedCommand = '';

// If we got any output - print it (if no error)
if (!e && ret !== undefined) {
if (!e) {
self.context._ = ret;
self.outputStream.write(exports.writer(ret) + '\n');
}
Expand Down

0 comments on commit bdb9d09

Please sign in to comment.