diff --git a/Jakefile.js b/Jakefile.js index 2e4a30c90c6..e55933ac03d 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -57,7 +57,7 @@ function measure(marker) { } var compilerSources = [ - "dataStructures.ts", + "collections.ts", "core.ts", "performance.ts", "sys.ts", @@ -92,7 +92,7 @@ var compilerSources = [ }); var servicesSources = [ - "dataStructures.ts", + "collections.ts", "core.ts", "performance.ts", "sys.ts", diff --git a/src/compiler/dataStructures.ts b/src/compiler/collections.ts similarity index 95% rename from src/compiler/dataStructures.ts rename to src/compiler/collections.ts index 57874c0f6c1..e553363e380 100644 --- a/src/compiler/dataStructures.ts +++ b/src/compiler/collections.ts @@ -8,7 +8,7 @@ namespace ts { const fullyFeaturedMaps = usingNativeMaps && "keys" in Map.prototype && "values" in Map.prototype && "entries" in Map.prototype; /** Extra Map methods that may not be available, so we must provide fallbacks. */ - interface FullyFeaturedMap extends Map { + interface ES6Map extends Map { keys(): Iterator; values(): Iterator; entries(): Iterator<[K, V]>; @@ -122,7 +122,7 @@ namespace ts { /** Iterates over entries in the map, returning the first output of `getResult` that is not `undefined`. */ export const findInMap: (map: Map, getResult: (value: V, key: K) => U | undefined) => U | undefined = fullyFeaturedMaps - ? (map: FullyFeaturedMap, f: (value: V, key: K) => U | undefined) => { + ? (map: ES6Map, f: (value: V, key: K) => U | undefined) => { const iter = map.entries(); while (true) { const { value: pair, done } = iter.next(); @@ -147,7 +147,7 @@ namespace ts { /** Whether `predicate` is true for at least one entry in the map. */ export const someInMap: (map: Map, predicate: (value: V, key: K) => boolean) => boolean = fullyFeaturedMaps - ? (map: FullyFeaturedMap, predicate: (value: V, key: K) => boolean) => + ? (map: ES6Map, predicate: (value: V, key: K) => boolean) => someInIterator(map.entries(), ([key, value]) => predicate(value, key)) : (map: Map, predicate: (value: V, key: K) => boolean) => { let found = false; @@ -159,13 +159,13 @@ namespace ts { /** Whether `predicate` is true for at least one key in the map. */ export const someKeyInMap: (map: Map, predicate: (key: K) => boolean) => boolean = fullyFeaturedMaps - ? (map: FullyFeaturedMap, predicate: (key: K) => boolean) => someInIterator(map.keys(), predicate) + ? (map: ES6Map, predicate: (key: K) => boolean) => someInIterator(map.keys(), predicate) : (map: Map, predicate: (key: K) => boolean) => someInMap(map, (_value, key) => predicate(key)); /** Whether `predicate` is true for at least one value in the map. */ export const someValueInMap: (map: Map, predicate: (value: T) => boolean) => boolean = fullyFeaturedMaps - ? (map: FullyFeaturedMap, predicate: (value: T) => boolean) => + ? (map: ES6Map, predicate: (value: T) => boolean) => someInIterator(map.values(), predicate) : someInMap; @@ -186,7 +186,7 @@ namespace ts { * `for (const key of map.keys()) action(key);` */ export const forEachKeyInMap: (map: Map, action: (key: K) => void) => void = fullyFeaturedMaps - ? (map: FullyFeaturedMap, f: (key: K) => void) => { + ? (map: ES6Map, f: (key: K) => void) => { const iter: Iterator = map.keys(); while (true) { const { value: key, done } = iter.next(); diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 65cbae6a7d2..8c06856d1b2 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1,4 +1,4 @@ -/// +/// /// /// @@ -916,7 +916,7 @@ namespace ts { /** * Returns the path except for its basename. Eg: - * + * * /path/to/file.ext -> /path/to */ export function getDirectoryPath(path: Path): Path; diff --git a/src/compiler/tsconfig.json b/src/compiler/tsconfig.json index 8dfa32b4884..19540367686 100644 --- a/src/compiler/tsconfig.json +++ b/src/compiler/tsconfig.json @@ -12,7 +12,7 @@ }, "files": [ "core.ts", - "dataStructures.ts", + "collections.ts", "performance.ts", "sys.ts", "types.ts", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 419971a8654..69061d42d6d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -13,7 +13,7 @@ namespace ts { * Map can only be instantiated using NumberMap and StringMap, which come with shims. * * Internet Explorer does not support iterator-returning methods, so those are not allowed here. - * But map-using functions in dataStructures.ts check for these features and use them where possible. + * But map-using functions in collections.ts check for these features and use them where possible. */ export interface Map { clear(): void;