mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
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:
parent
bfffd44457
commit
f3adc11e37
1 changed files with 2 additions and 1 deletions
|
@ -222,7 +222,8 @@ function getErrMessage(message, fn) {
|
||||||
}
|
}
|
||||||
const frames = StringPrototypeSplit(message, '\n');
|
const frames = StringPrototypeSplit(message, '\n');
|
||||||
message = ArrayPrototypeShift(frames);
|
message = ArrayPrototypeShift(frames);
|
||||||
for (const frame of frames) {
|
for (let i = 0; i < frames.length; i++) {
|
||||||
|
const frame = frames[i];
|
||||||
let pos = 0;
|
let pos = 0;
|
||||||
while (pos < column && (frame[pos] === ' ' || frame[pos] === '\t')) {
|
while (pos < column && (frame[pos] === ' ' || frame[pos] === '\t')) {
|
||||||
pos++;
|
pos++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue