From 56a8b7dc643974768e21fdf12169b4cc1e3a5aef Mon Sep 17 00:00:00 2001 From: Soar <58918356+soar-beep@users.noreply.github.com> Date: Sun, 15 Dec 2019 19:45:15 -0500 Subject: [PATCH] assert: use for...of Refs: #30960 --- lib/assert.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/assert.js b/lib/assert.js index 828a443ec9290a..8cf83caf3db8de 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);