Skip to content

Commit a4ad26d

Browse files
Trottdanielleadams
authored andcommitted
util: check for null instead of flasy in loop
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 63a67f8 commit a4ad26d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/util/inspect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ function formatError(err, constructor, tag, ctx, keys) {
13111311
let nodeModule;
13121312
newStack += '\n';
13131313
let pos = 0;
1314-
while (nodeModule = nodeModulesRegExp.exec(line)) {
1314+
while ((nodeModule = nodeModulesRegExp.exec(line)) !== null) {
13151315
// '/node_modules/'.length === 14
13161316
newStack += line.slice(pos, nodeModule.index + 14);
13171317
newStack += ctx.stylize(nodeModule[1], 'module');

0 commit comments

Comments
 (0)