From d0f047dfe7ab863dc2fb755d5569bdce463d9623 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 7 Apr 2011 19:40:45 -0400 Subject: [PATCH] improved fix for #1266 --- src/repl.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/repl.coffee b/src/repl.coffee index f3d02dc3..308612cf 100644 --- a/src/repl.coffee +++ b/src/repl.coffee @@ -14,8 +14,8 @@ Script = process.binding('evals').Script # Config enableColours = no -if process.platform isnt 'win32' - enableColours = !process.env.NODE_DISABLE_COLORS +unless process.platform is 'win32' + enableColours = not process.env.NODE_DISABLE_COLORS # Start by opening up `stdin` and `stdout`. stdin = process.openStdin() @@ -38,7 +38,8 @@ run = (buffer) -> backlog = '' try val = CoffeeScript.eval code, bare: on, globals: on, filename: 'repl' - process.stdout.write inspect(val, no, 2, enableColours) + '\n' if val isnt undefined + unless val is undefined + process.stdout.write inspect(val, no, 2, enableColours) + '\n' catch err error err repl.prompt()