Skip to content

Commit f8aa365

Browse files
soar-beepBridgeAR
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 d09bca9 commit f8aa365

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
@@ -868,9 +868,9 @@ assert.ifError = function ifError(err) {
868868
tmp2.shift();
869869
// Filter all frames existing in err.stack.
870870
let tmp1 = newErr.stack.split('\n');
871-
for (let i = 0; i < tmp2.length; i++) {
871+
for (const errFrame of tmp2) {
872872
// Find the first occurrence of the frame.
873-
const pos = tmp1.indexOf(tmp2[i]);
873+
const pos = tmp1.indexOf(errFrame);
874874
if (pos !== -1) {
875875
// Only keep new frames.
876876
tmp1 = tmp1.slice(0, pos);

0 commit comments

Comments
 (0)