[repl] add error handling for async scope fetching

This commit is contained in:
Fedor Indutny 2011-09-11 21:52:24 +07:00 committed by Ryan Dahl
parent 69c35f990f
commit 57388d8b2e

View File

@ -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);