mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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>
This commit is contained in:
1 parent
4cc10d5fd4
commit
6909e3e656
1 file changed
+2
-2
+2
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user