Skip to content

Commit

Permalink
assert: use for...of
Browse files Browse the repository at this point in the history
  • Loading branch information
soar-beep committed Dec 16, 2019
1 parent ba29e27 commit 56a8b7d
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 56a8b7d

Please sign in to comment.