From 57388d8b2ef491b00da9a008d2ca816d3036c9a8 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sun, 11 Sep 2011 21:52:24 +0700 Subject: [PATCH] [repl] add error handling for async scope fetching --- lib/repl.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/repl.js b/lib/repl.js index cc9b227a276..27eeaf5d134 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -405,7 +405,9 @@ REPLServer.prototype.complete = function(line, callback) { completionGroupsLoaded(); } else { this.eval('.scope', this.context, 'repl', function(err, globals) { - if (Array.isArray(globals[0])) { + if (err || !globals) { + addStandardGlobals(); + } else if (Array.isArray(globals[0])) { // Add grouped globals globals.forEach(function(group) { completionGroups.push(group);