Merge pull request #28951 from Microsoft/fixLibToIterableAndES5

Only use 'es2015.iterable' to avoid accidental es2015 feature usage.
This commit is contained in:
Daniel Rosenwasser
2018-12-11 13:29:39 -08:00
committed by GitHub
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -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 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"pretty": true,
"lib": ["es2015"],
"lib": ["es2015.iterable", "es5"],
"target": "es5",
"rootDir": ".",