Skip to content

Commit 73aa0ae

Browse files
JinhyeokFangaduh95
authored andcommitted
assert: change utils to use index instead of for...of
PR-URL: #59278 Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration Reviewed-By: Jordan Harband <ljharb@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
1 parent 76dab34 commit 73aa0ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/assert/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ function getErrMessage(message, fn) {
222222
}
223223
const frames = StringPrototypeSplit(message, '\n');
224224
message = ArrayPrototypeShift(frames);
225-
for (const frame of frames) {
225+
for (let i = 0; i < frames.length; i++) {
226+
const frame = frames[i];
226227
let pos = 0;
227228
while (pos < column && (frame[pos] === ' ' || frame[pos] === '\t')) {
228229
pos++;

0 commit comments

Comments
 (0)