Skip to content

Commit 28c3663

Browse files
Don't use 'fill' in 'fill'.
1 parent cc477ee commit 28c3663

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/compiler/core.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2165,6 +2165,10 @@ namespace ts {
21652165
}
21662166

21672167
export function fill<T>(length: number, cb: (index: number) => T): T[] {
2168-
return new Array(length).fill(0).map((_, i) => cb(i));
2168+
const result = Array<T>(length);
2169+
for (let i = 0; i < length; i++) {
2170+
result[i] = cb(i);
2171+
}
2172+
return result;
21692173
}
21702174
}

0 commit comments

Comments
 (0)