mirror of
https://github.com/samsonjs/repl-edit.git
synced 2026-04-25 14:47:45 +00:00
fix output for new node version, how did this slip by?!
This commit is contained in:
parent
1f0b036dcb
commit
a1b1d791aa
1 changed files with 5 additions and 4 deletions
|
|
@ -11,6 +11,7 @@ var fs = require('fs')
|
||||||
, spawn = require('child_process').spawn
|
, spawn = require('child_process').spawn
|
||||||
, util = require('util')
|
, util = require('util')
|
||||||
, Hint = 'Commands: .edit, .run, .stash <filename>, .unstash <filename>, .editor <editor>'
|
, Hint = 'Commands: .edit, .run, .stash <filename>, .unstash <filename>, .editor <editor>'
|
||||||
|
, replModule = require('repl')
|
||||||
, repl
|
, repl
|
||||||
|
|
||||||
module.exports = { startRepl: startRepl, extendRepl: extendRepl }
|
module.exports = { startRepl: startRepl, extendRepl: extendRepl }
|
||||||
|
|
@ -175,15 +176,15 @@ function run(filename, callback) {
|
||||||
// Use evalcx to supply the global context
|
// Use evalcx to supply the global context
|
||||||
var ret = evalcx(s, repl.context, "repl");
|
var ret = evalcx(s, repl.context, "repl");
|
||||||
if (ret !== undefined) {
|
if (ret !== undefined) {
|
||||||
repl.context._ = ret;
|
repl.context._ = ret
|
||||||
repl.writer(ret) + "\n"
|
repl.outputStream.write(replModule.writer(ret) + '\n')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// On error: Print the error and clear the buffer
|
// On error: Print the error and clear the buffer
|
||||||
if (e.stack) {
|
if (e.stack) {
|
||||||
log(e.stack + "\n");
|
log(e.stack + "\n")
|
||||||
} else {
|
} else {
|
||||||
log(e.toString() + "\n");
|
log(e.toString() + "\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (callback) callback()
|
if (callback) callback()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue