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:36:33 +0300
committerRich Trott <rtrott@gmail.com>2022-01-23 06:38:13 +0300
commitac069510494e8071f136137f34b56d235d066dd2 (patch)
treeea791adb1138800320d719032aa582a8a7cbd9ea /lib
parentbd422452da0d6750793628cbaa5bda4c2cf53770 (diff)
util: check for null instead of flasy in loop
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/internal/util/inspect.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js
index 814e5bf0f37..ca3227dea43 100644
--- a/lib/internal/util/inspect.js
+++ b/lib/internal/util/inspect.js
@@ -1311,7 +1311,7 @@ function formatError(err, constructor, tag, ctx, keys) {
let nodeModule;
newStack += '\n';
let pos = 0;
- while (nodeModule = nodeModulesRegExp.exec(line)) {
+ while ((nodeModule = nodeModulesRegExp.exec(line)) !== null) {
// '/node_modules/'.length === 14
newStack += line.slice(pos, nodeModule.index + 14);
newStack += ctx.stylize(nodeModule[1], 'module');