repl: remove unnecessary check for globals

There is no need to check for globals and also check if it is
an array.

PR-URL: https://github.com/nodejs/io.js/pull/1722
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
pull/1708/merge
Yazhong Liu 2015-05-18 01:25:19 +08:00 committed by cjihrig
parent fbaef40e63
commit 5f33521be5
1 changed files with 1 additions and 1 deletions

View File

@ -624,7 +624,7 @@ REPLServer.prototype.complete = function(line, callback) {
completionGroupsLoaded();
} else {
this.eval('.scope', this.context, 'repl', function(err, globals) {
if (err || !globals || !Array.isArray(globals)) {
if (err || !Array.isArray(globals)) {
addStandardGlobals(completionGroups, filter);
} else if (Array.isArray(globals[0])) {
// Add grouped globals