From a1b1d791aaffb142aa7ae4cb53acc1500a9967ce Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Mon, 30 May 2011 01:03:17 -0700 Subject: [PATCH] fix output for new node version, how did this slip by?! --- lib/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index 7b09e80..65db419 100644 --- a/lib/index.js +++ b/lib/index.js @@ -11,6 +11,7 @@ var fs = require('fs') , spawn = require('child_process').spawn , util = require('util') , Hint = 'Commands: .edit, .run, .stash , .unstash , .editor ' + , replModule = require('repl') , repl module.exports = { startRepl: startRepl, extendRepl: extendRepl } @@ -175,15 +176,15 @@ function run(filename, callback) { // Use evalcx to supply the global context var ret = evalcx(s, repl.context, "repl"); if (ret !== undefined) { - repl.context._ = ret; - repl.writer(ret) + "\n" + repl.context._ = ret + repl.outputStream.write(replModule.writer(ret) + '\n') } } catch (e) { // On error: Print the error and clear the buffer if (e.stack) { - log(e.stack + "\n"); + log(e.stack + "\n") } else { - log(e.toString() + "\n"); + log(e.toString() + "\n") } } if (callback) callback()