Skip to content

Commit

Permalink
repl: check for precise values rather than falsy in loops
Browse files Browse the repository at this point in the history
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 authored and BethGriggs committed Jan 24, 2022
1 parent 0e35d01 commit 301a4f8
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 301a4f8

Please sign in to comment.