Skip to content

Commit dacffd3

Browse files
Trottdanielleadams
authored andcommitted
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>
1 parent a4ad26d commit dacffd3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎lib/repl.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ function REPLServer(prompt,
381381
paused=false;
382382
letentry;
383383
consttmpCompletionEnabled=self.isCompletionEnabled;
384-
while(entry=ArrayPrototypeShift(pausedBuffer)){
384+
while((entry=ArrayPrototypeShift(pausedBuffer))!==undefined){
385385
const{0: type,1: payload,2: isCompletionEnabled}=entry;
386386
switch(type){
387387
case'key': {
@@ -1450,7 +1450,7 @@ function complete(line, callback) {
14501450
ArrayPrototypePush(completionGroups,
14511451
getGlobalLexicalScopeNames(this[kContextId]));
14521452
letcontextProto=this.context;
1453-
while(contextProto=ObjectGetPrototypeOf(contextProto)){
1453+
while((contextProto=ObjectGetPrototypeOf(contextProto))!==null){
14541454
ArrayPrototypePush(completionGroups,
14551455
filteredOwnPropertyNames(contextProto));
14561456
}

0 commit comments

Comments
 (0)