diff --git a/lib/repl.js b/lib/repl.js index 43af9c7c0e09a9..c576f5b7f3094d 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -381,7 +381,7 @@ function REPLServer(prompt, paused = false; let entry; const tmpCompletionEnabled = self.isCompletionEnabled; - while (entry = ArrayPrototypeShift(pausedBuffer)) { + while ((entry = ArrayPrototypeShift(pausedBuffer)) !== undefined) { const { 0: type, 1: payload, 2: isCompletionEnabled } = entry; switch (type) { case 'key': { @@ -1450,7 +1450,7 @@ function complete(line, callback) { ArrayPrototypePush(completionGroups, getGlobalLexicalScopeNames(this[kContextId])); let contextProto = this.context; - while (contextProto = ObjectGetPrototypeOf(contextProto)) { + while ((contextProto = ObjectGetPrototypeOf(contextProto)) !== null) { ArrayPrototypePush(completionGroups, filteredOwnPropertyNames(contextProto)); }