Skip to content

Commit 145116b

Browse files
soar-beepTrott
authored andcommitted
assert: use for...of
Refs: #30960 PR-URL: #30983 Refs: #30960 Reviewed-By: David Carlier <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent bef1e87 commit 145116b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/assert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,9 +869,9 @@ assert.ifError = function ifError(err) {
869869
tmp2.shift();
870870
// Filter all frames existing in err.stack.
871871
let tmp1 = newErr.stack.split('\n');
872-
for (let i = 0; i < tmp2.length; i++) {
872+
for (const errFrame of tmp2) {
873873
// Find the first occurrence of the frame.
874-
const pos = tmp1.indexOf(tmp2[i]);
874+
const pos = tmp1.indexOf(errFrame);
875875
if (pos !== -1) {
876876
// Only keep new frames.
877877
tmp1 = tmp1.slice(0, pos);

0 commit comments

Comments
 (0)