Skip to content
Prev Previous commit
Next Next commit
repl: check for precise values rather than falsy in loops
This prepares the code for the no-cond-assign ESLint rule.

PR-URL: #41614
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott committed Jan 23, 2022
commit 348469b87a191acd7b5826526ca8f6c7af7daca1
4 changes: 2 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down Expand Up @@ -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));
}
Expand Down