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.useGlobal' is a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Mar 28, 2012
1 parent f41901c commit e7065ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/repl.js
Expand Up @@ -101,12 +101,12 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) {

var self = this;

self.useGlobal = useGlobal;
self.useGlobal = !!useGlobal;

self.eval = eval || function(code, context, file, cb) {
var err, result;
try {
if (useGlobal) {
if (self.useGlobal) {
result = vm.runInThisContext(code, file);
} else {
result = vm.runInContext(code, context, file);
Expand Down

0 comments on commit e7065ea

Please sign in to comment.