Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow util.inspect (or other writer) to return null or undefined to s…

…ignal no write (to bypass newline)
  • Loading branch information...
commit a7fd3cef6611d315b3c9f6761e2ad0c436c4e815 1 parent 698b1da
@deanlandolt authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/repl.js
View
6 lib/repl.js
@@ -170,7 +170,11 @@ function REPLServer(prompt, stream) {
if (ret !== undefined) {
self.context._ = ret;
- self.outputStream.write(exports.writer(ret) + '\n');
+ // allow custom writer to return null or undefined as a signal to not write
+ var str = exports.writer(ret);
+ if (str != null) {
+ self.outputStream.write(str + '\n');
+ }
}
self.bufferedCommand = '';
Please sign in to comment.
Something went wrong with that request. Please try again.