Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2022-01-20 17:38:40 +0300
committerRich Trott <rtrott@gmail.com>2022-01-23 06:38:15 +0300
commit348469b87a191acd7b5826526ca8f6c7af7daca1 (patch)
treebfd48b376f699f73691003737f7a9e6f10ee44ce /lib
parentac069510494e8071f136137f34b56d235d066dd2 (diff)
repl: check for precise values rather than falsy in loops
This prepares the code for the no-cond-assign ESLint rule. PR-URL: https://github.com/nodejs/node/pull/41614 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/repl.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/repl.js b/lib/repl.js
index 43af9c7c0e0..c576f5b7f30 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -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': {
@@ -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));
}