mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
repl: ensure that 'repl.ignoreUndefined' is a boolean
This commit is contained in:
1 parent
e7065eaa93
commit
228ddddc1c
1 file changed
+2
-1
+2
-1
@@ -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