diff options
author | Nathan Rajlich <nathan@tootallnate.net> | 2012-03-28 04:35:33 +0400 |
---|---|---|
committer | Nathan Rajlich <nathan@tootallnate.net> | 2012-03-28 04:35:33 +0400 |
commit | 228ddddc1cee6876e951a5365b3d3de2a00ef9ef (patch) | |
tree | 942981546e56ace3cbfd8b2171bd1d7eacb05ca2 /lib | |
parent | e7065eaa93466c090d3f3d13f67ed64aab5363a9 (diff) |
repl: ensure that 'repl.ignoreUndefined' is a boolean
Diffstat (limited to 'lib')
-rw-r--r-- | lib/repl.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/repl.js b/lib/repl.js index 89ac5685f67..2ee5c76aa0c 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -102,6 +102,7 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) { var self = this; self.useGlobal = !!useGlobal; + self.ignoreUndefined = !!ignoreUndefined; self.eval = eval || function(code, context, file, cb) { var err, result; @@ -290,7 +291,7 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) { self.bufferedCommand = ''; // If we got any output - print it (if no error) - if (!e && (!ignoreUndefined || ret !== undefined)) { + if (!e && (!self.ignoreUndefined || ret !== undefined)) { self.context._ = ret; self.outputStream.write(exports.writer(ret) + '\n'); } |