Skip to content

Commit 0e35d01

Browse files
TrottBethGriggs
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 2b4e46f commit 0e35d01

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)