Skip to content

Commit

Permalink
assert: use for...of
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
soar-beep authored and Trott committed Dec 18, 2019
1 parent bef1e87 commit 145116b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,9 @@ assert.ifError = function ifError(err) {
tmp2.shift();
// Filter all frames existing in err.stack.
let tmp1 = newErr.stack.split('\n');
for (let i = 0; i < tmp2.length; i++) {
for (const errFrame of tmp2) {
// Find the first occurrence of the frame.
const pos = tmp1.indexOf(tmp2[i]);
const pos = tmp1.indexOf(errFrame);
if (pos !== -1) {
// Only keep new frames.
tmp1 = tmp1.slice(0, pos);
Expand Down

0 comments on commit 145116b

Please sign in to comment.