mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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>
This commit is contained in:
1 parent
2b4e46f07d
commit
0e35d01a4a
1 file changed
+1
-1
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user