Skip to content

Commit

Permalink
util: check for null instead of flasy in loop
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Trott authored and BethGriggs committed Jan 24, 2022
1 parent 2b4e46f commit 0e35d01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 0e35d01

Please sign in to comment.