Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
repl: ensure that 'repl.ignoreUndefined' is a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Mar 28, 2012
1 parent e7065ea commit 228dddd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/repl.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
Expand Down

0 comments on commit 228dddd

Please sign in to comment.