assert: change utils to use index instead of for...of

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
방진혁 authored and RafaelGSS committed 2025-08-12 09:20:02 -03:00
1 parent 8d9ceeaf6a
commit f7484575ff
1 file changed
+2 -1
+2 -1
View File
@@ -222,7 +222,8 @@ function getErrMessage(message, fn) {
}
const frames = StringPrototypeSplit(message, '\n');
message = ArrayPrototypeShift(frames);
for (const frame of frames) {
for (let i = 0; i < frames.length; i++) {
const frame = frames[i];
let pos = 0;
while (pos < column && (frame[pos] === ' ' || frame[pos] === '\t')) {
pos++;