Skip to content

Commit 221054d

Browse files
author
Andy Hanson
committed
Respond to PR comments
1 parent 7217274 commit 221054d

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

Jakefile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function measure(marker) {
5757
}
5858

5959
var compilerSources = [
60-
"dataStructures.ts",
60+
"collections.ts",
6161
"core.ts",
6262
"performance.ts",
6363
"sys.ts",
@@ -92,7 +92,7 @@ var compilerSources = [
9292
});
9393

9494
var servicesSources = [
95-
"dataStructures.ts",
95+
"collections.ts",
9696
"core.ts",
9797
"performance.ts",
9898
"sys.ts",
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace ts {
88
const fullyFeaturedMaps = usingNativeMaps && "keys" in Map.prototype && "values" in Map.prototype && "entries" in Map.prototype;
99

1010
/** Extra Map methods that may not be available, so we must provide fallbacks. */
11-
interface FullyFeaturedMap<K, V> extends Map<K, V> {
11+
interface ES6Map<K, V> extends Map<K, V> {
1212
keys(): Iterator<K>;
1313
values(): Iterator<V>;
1414
entries(): Iterator<[K, V]>;
@@ -122,7 +122,7 @@ namespace ts {
122122

123123
/** Iterates over entries in the map, returning the first output of `getResult` that is not `undefined`. */
124124
export const findInMap: <K, V, U>(map: Map<K, V>, getResult: (value: V, key: K) => U | undefined) => U | undefined = fullyFeaturedMaps
125-
? <K, V, U>(map: FullyFeaturedMap<K, V>, f: (value: V, key: K) => U | undefined) => {
125+
? <K, V, U>(map: ES6Map<K, V>, f: (value: V, key: K) => U | undefined) => {
126126
const iter = map.entries();
127127
while (true) {
128128
const { value: pair, done } = iter.next();
@@ -147,7 +147,7 @@ namespace ts {
147147

148148
/** Whether `predicate` is true for at least one entry in the map. */
149149
export const someInMap: <K, V>(map: Map<K, V>, predicate: (value: V, key: K) => boolean) => boolean = fullyFeaturedMaps
150-
? <K, V>(map: FullyFeaturedMap<K, V>, predicate: (value: V, key: K) => boolean) =>
150+
? <K, V>(map: ES6Map<K, V>, predicate: (value: V, key: K) => boolean) =>
151151
someInIterator(map.entries(), ([key, value]) => predicate(value, key))
152152
: <K, V>(map: Map<K, V>, predicate: (value: V, key: K) => boolean) => {
153153
let found = false;
@@ -159,13 +159,13 @@ namespace ts {
159159

160160
/** Whether `predicate` is true for at least one key in the map. */
161161
export const someKeyInMap: <K>(map: Map<K, any>, predicate: (key: K) => boolean) => boolean = fullyFeaturedMaps
162-
? <K>(map: FullyFeaturedMap<K, any>, predicate: (key: K) => boolean) => someInIterator(map.keys(), predicate)
162+
? <K>(map: ES6Map<K, any>, predicate: (key: K) => boolean) => someInIterator(map.keys(), predicate)
163163
: <K>(map: Map<K, any>, predicate: (key: K) => boolean) =>
164164
someInMap(map, (_value, key) => predicate(key));
165165

166166
/** Whether `predicate` is true for at least one value in the map. */
167167
export const someValueInMap: <T>(map: Map<any, T>, predicate: (value: T) => boolean) => boolean = fullyFeaturedMaps
168-
? <T>(map: FullyFeaturedMap<any, T>, predicate: (value: T) => boolean) =>
168+
? <T>(map: ES6Map<any, T>, predicate: (value: T) => boolean) =>
169169
someInIterator(map.values(), predicate)
170170
: someInMap;
171171

@@ -186,7 +186,7 @@ namespace ts {
186186
* `for (const key of map.keys()) action(key);`
187187
*/
188188
export const forEachKeyInMap: <K>(map: Map<K, any>, action: (key: K) => void) => void = fullyFeaturedMaps
189-
? <K>(map: FullyFeaturedMap<K, any>, f: (key: K) => void) => {
189+
? <K>(map: ES6Map<K, any>, f: (key: K) => void) => {
190190
const iter: Iterator<K> = map.keys();
191191
while (true) {
192192
const { value: key, done } = iter.next();

src/compiler/core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="dataStructures.ts" />
1+
/// <reference path="collections.ts" />
22
/// <reference path="types.ts"/>
33
/// <reference path="performance.ts" />
44

@@ -916,7 +916,7 @@ namespace ts {
916916

917917
/**
918918
* Returns the path except for its basename. Eg:
919-
*
919+
*
920920
* /path/to/file.ext -> /path/to
921921
*/
922922
export function getDirectoryPath(path: Path): Path;

src/compiler/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"files": [
1414
"core.ts",
15-
"dataStructures.ts",
15+
"collections.ts",
1616
"performance.ts",
1717
"sys.ts",
1818
"types.ts",

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace ts {
1313
* Map can only be instantiated using NumberMap and StringMap, which come with shims.
1414
*
1515
* Internet Explorer does not support iterator-returning methods, so those are not allowed here.
16-
* But map-using functions in dataStructures.ts check for these features and use them where possible.
16+
* But map-using functions in collections.ts check for these features and use them where possible.
1717
*/
1818
export interface Map<K, V> {
1919
clear(): void;

0 commit comments

Comments
 (0)