mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #28951 from Microsoft/fixLibToIterableAndES5
Only use 'es2015.iterable' to avoid accidental es2015 feature usage.
This commit is contained in:
@@ -2165,6 +2165,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function fill<T>(length: number, cb: (index: number) => T): T[] {
|
||||
return new Array(length).fill(0).map((_, i) => cb(i));
|
||||
const result = Array<T>(length);
|
||||
for (let i = 0; i < length; i++) {
|
||||
result[i] = cb(i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"pretty": true,
|
||||
"lib": ["es2015"],
|
||||
"lib": ["es2015.iterable", "es5"],
|
||||
"target": "es5",
|
||||
"rootDir": ".",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user