diff options
author | Soar <58918356+soar-beep@users.noreply.github.com> | 2019-12-16 03:45:15 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-12-18 04:33:12 +0300 |
commit | 145116b3a16905291f3f1c96646aa89730271002 (patch) | |
tree | 5b4907db80ccada752db2e4ad1f136f5a34480f8 /lib | |
parent | bef1e87e1cf3f5cd4f5ff22c787a0f3adc2c2b7b (diff) |
assert: use for...of
Refs: #30960
PR-URL: https://github.com/nodejs/node/pull/30983
Refs: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/assert.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/assert.js b/lib/assert.js index 828a443ec92..8cf83caf3db 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -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); |