Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dacffd3

Browse filesBrowse 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
Copy full SHA for dacffd3

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎lib/repl.js‎

Copy file name to clipboardExpand all lines: lib/repl.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ function REPLServer(prompt,
381381
paused = false;
382382
let entry;
383383
const tmpCompletionEnabled = 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
let contextProto = 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.