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 targos committed Jan 14, 2020
1 parent 49a9b31 commit 9da5444
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 @@ -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 9da5444

Please sign in to comment.