Skip to content

Commit 56a8b7d

Browse files
committed
assert: use for...of
Refs: nodejs#30960
1 parent ba29e27 commit 56a8b7d

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
@@ -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)