Skip to content

Commit 9da5444

Browse files
soar-beeptargos
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 49a9b31 commit 9da5444

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/assert.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,9 @@ assert.ifError = function ifError(err) {
831831
tmp2.shift();
832832
// Filter all frames existing in err.stack.
833833
let tmp1 = newErr.stack.split('\n');
834-
for (let i = 0; i < tmp2.length; i++) {
834+
for (const errFrame of tmp2) {
835835
// Find the first occurrence of the frame.
836-
const pos = tmp1.indexOf(tmp2[i]);
836+
const pos = tmp1.indexOf(errFrame);
837837
if (pos !== -1) {
838838
// Only keep new frames.
839839
tmp1 = tmp1.slice(0, pos);

0 commit comments

Comments
 (0)