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 <devnexen@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
soar-beep authored and BethGriggs committed Feb 6, 2020
1 parent 4cc10d5 commit 6909e3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/assert.js
Expand Up @@ -831,9 +831,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 6909e3e

Please sign in to comment.