mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
repl: ensure that 'repl.ignoreUndefined' is a boolean
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user