Skip to content

Commit eb45962

Browse files
author
Andy Hanson
committed
Rename to zipWith
1 parent ca09ef4 commit eb45962

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/compiler/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ namespace ts {
124124
return undefined;
125125
}
126126

127-
export function zip<T, U>(arrayA: T[], arrayB: U[], callback: (a: T, b: U, index: number) => void): void {
127+
export function zipWith<T, U>(arrayA: T[], arrayB: U[], callback: (a: T, b: U, index: number) => void): void {
128128
Debug.assert(arrayA.length === arrayB.length);
129129
for (let i = 0; i < arrayA.length; i++) {
130130
callback(arrayA[i], arrayB[i], i);

src/harness/fourslash.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ namespace FourSlash {
579579
this.raiseError(`goToDefinitions failed - expected to find ${endMarkers.length} definitions but got ${definitions.length}`);
580580
}
581581

582-
ts.zip(endMarkers, definitions, (endMarker, definition, i) => {
582+
ts.zipWith(endMarkers, definitions, (endMarker, definition, i) => {
583583
const marker = this.getMarkerByName(endMarker);
584584
if (marker.fileName !== definition.fileName || marker.position !== definition.textSpan.start) {
585585
this.raiseError(`goToDefinition failed for definition ${i}: expected ${marker.fileName} at ${marker.position}, got ${definition.fileName} at ${definition.textSpan.start}`);
@@ -601,7 +601,7 @@ namespace FourSlash {
601601
public verifyGetEmitOutputContentsForCurrentFile(expected: ts.OutputFile[]): void {
602602
const emit = this.languageService.getEmitOutput(this.activeFile.fileName);
603603
assert.equal(emit.outputFiles.length, expected.length, "Number of emit output files");
604-
ts.zip(emit.outputFiles, expected, (outputFile, expected) => {
604+
ts.zipWith(emit.outputFiles, expected, (outputFile, expected) => {
605605
assert.equal(outputFile.name, expected.name, "FileName");
606606
assert.equal(outputFile.text, expected.text, "Content");
607607
});
@@ -667,7 +667,7 @@ namespace FourSlash {
667667

668668
const entries = this.getCompletionListAtCaret().entries;
669669
assert.isTrue(items.length <= entries.length, `Amount of expected items in completion list [ ${items.length} ] is greater than actual number of items in list [ ${entries.length} ]`);
670-
ts.zip(entries, items, (entry, item) => {
670+
ts.zipWith(entries, items, (entry, item) => {
671671
assert.equal(entry.name, item, `Unexpected item in completion list`);
672672
});
673673
}
@@ -993,7 +993,7 @@ namespace FourSlash {
993993
ranges = ranges.sort((r1, r2) => r1.start - r2.start);
994994
references = references.sort((r1, r2) => r1.textSpan.start - r2.textSpan.start);
995995

996-
ts.zip(references, ranges, (reference, range) => {
996+
ts.zipWith(references, ranges, (reference, range) => {
997997
if (reference.textSpan.start !== range.start || ts.textSpanEnd(reference.textSpan) !== range.end) {
998998
this.raiseError("Rename location results do not match.\n\nExpected: " + stringify(ranges) + "\n\nActual:" + JSON.stringify(references));
999999
}
@@ -1891,7 +1891,7 @@ namespace FourSlash {
18911891
jsonMismatchString());
18921892
}
18931893

1894-
ts.zip(expected, actual, (expectedClassification, actualClassification) => {
1894+
ts.zipWith(expected, actual, (expectedClassification, actualClassification) => {
18951895
const expectedType: string = (<any>ts.ClassificationTypeNames)[expectedClassification.classificationType];
18961896
if (expectedType !== actualClassification.classificationType) {
18971897
this.raiseError("verifyClassifications failed - expected classifications type to be " +
@@ -1966,7 +1966,7 @@ namespace FourSlash {
19661966
this.raiseError(`verifyOutliningSpans failed - expected total spans to be ${spans.length}, but was ${actual.length}`);
19671967
}
19681968

1969-
ts.zip(spans, actual, (expectedSpan, actualSpan, i) => {
1969+
ts.zipWith(spans, actual, (expectedSpan, actualSpan, i) => {
19701970
if (expectedSpan.start !== actualSpan.textSpan.start || expectedSpan.end !== ts.textSpanEnd(actualSpan.textSpan)) {
19711971
this.raiseError(`verifyOutliningSpans failed - span ${(i + 1)} expected: (${expectedSpan.start},${expectedSpan.end}), actual: (${actualSpan.textSpan.start},${ts.textSpanEnd(actualSpan.textSpan)})`);
19721972
}
@@ -1981,7 +1981,7 @@ namespace FourSlash {
19811981
this.raiseError(`verifyTodoComments failed - expected total spans to be ${spans.length}, but was ${actual.length}`);
19821982
}
19831983

1984-
ts.zip(spans, actual, (expectedSpan, actualComment, i) => {
1984+
ts.zipWith(spans, actual, (expectedSpan, actualComment, i) => {
19851985
const actualCommentSpan = ts.createTextSpan(actualComment.position, actualComment.message.length);
19861986

19871987
if (expectedSpan.start !== actualCommentSpan.start || expectedSpan.end !== ts.textSpanEnd(actualCommentSpan)) {

0 commit comments

Comments
 (0)