Skip to content

Commit f3adc11

Browse files
authored
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 <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]>
1 parent bfffd44 commit f3adc11

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)