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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
Trott authored and danielleadams committed Mar 14, 2022
1 parent a4ad26d commit dacffd3
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 dacffd3

Please sign in to comment.