Skip to content

Commit 1e12bf2

Browse files
committed
UNINDENT
1 parent e13cf71 commit 1e12bf2

File tree

432 files changed

+245826
-245826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

432 files changed

+245826
-245826
lines changed

Diff for: src/compiler/binder.ts

+3,044-3,044
Large diffs are not rendered by default.

Diff for: src/compiler/builder.ts

+1,195-1,195
Large diffs are not rendered by default.

Diff for: src/compiler/builderPublic.ts

+160-160
Large diffs are not rendered by default.

Diff for: src/compiler/builderState.ts

+541-541
Large diffs are not rendered by default.

Diff for: src/compiler/builderStatePublic.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
namespace ts {
2-
export interface EmitOutput {
3-
outputFiles: OutputFile[];
4-
emitSkipped: boolean;
5-
/* @internal */ diagnostics: readonly ts.Diagnostic[];
6-
/* @internal */ exportedModulesFromDeclarationEmit?: ts.ExportedModulesFromDeclarationEmit;
7-
}
2+
export interface EmitOutput {
3+
outputFiles: OutputFile[];
4+
emitSkipped: boolean;
5+
/* @internal */ diagnostics: readonly ts.Diagnostic[];
6+
/* @internal */ exportedModulesFromDeclarationEmit?: ts.ExportedModulesFromDeclarationEmit;
7+
}
88

9-
export interface OutputFile {
10-
name: string;
11-
writeByteOrderMark: boolean;
12-
text: string;
13-
}
9+
export interface OutputFile {
10+
name: string;
11+
writeByteOrderMark: boolean;
12+
text: string;
13+
}
1414
}

Diff for: src/compiler/checker.ts

+37,717-37,717
Large diffs are not rendered by default.

Diff for: src/compiler/commandLineParser.ts

+3,157-3,157
Large diffs are not rendered by default.

Diff for: src/compiler/core.ts

+2,110-2,110
Large diffs are not rendered by default.

Diff for: src/compiler/corePublic.ts

+155-155
Original file line numberDiff line numberDiff line change
@@ -1,179 +1,179 @@
11
namespace ts {
2-
// WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
3-
// If changing the text in this section, be sure to test `configurePrerelease` too.
4-
export const versionMajorMinor = "4.8";
5-
// The following is baselined as a literal template type without intervention
6-
/** The version of the TypeScript compiler release */
7-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
8-
export const version: string = `${versionMajorMinor}.0-dev`;
2+
// WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
3+
// If changing the text in this section, be sure to test `configurePrerelease` too.
4+
export const versionMajorMinor = "4.8";
5+
// The following is baselined as a literal template type without intervention
6+
/** The version of the TypeScript compiler release */
7+
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
8+
export const version: string = `${versionMajorMinor}.0-dev`;
9+
10+
/**
11+
* Type of objects whose values are all of the same type.
12+
* The `in` and `for-in` operators can *not* be safely used,
13+
* since `Object.prototype` may be modified by outside code.
14+
*/
15+
export interface MapLike<T> {
16+
[index: string]: T;
17+
}
918

10-
/**
11-
* Type of objects whose values are all of the same type.
12-
* The `in` and `for-in` operators can *not* be safely used,
13-
* since `Object.prototype` may be modified by outside code.
14-
*/
15-
export interface MapLike<T> {
16-
[index: string]: T;
17-
}
19+
export interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
20+
" __sortedArrayBrand": any;
21+
}
1822

19-
export interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
20-
" __sortedArrayBrand": any;
21-
}
23+
export interface SortedArray<T> extends Array<T> {
24+
" __sortedArrayBrand": any;
25+
}
2226

23-
export interface SortedArray<T> extends Array<T> {
24-
" __sortedArrayBrand": any;
25-
}
27+
/** Common read methods for ES6 Map/Set. */
28+
export interface ReadonlyCollection<K> {
29+
readonly size: number;
30+
has(key: K): boolean;
31+
keys(): Iterator<K>;
32+
}
2633

27-
/** Common read methods for ES6 Map/Set. */
28-
export interface ReadonlyCollection<K> {
29-
readonly size: number;
30-
has(key: K): boolean;
31-
keys(): Iterator<K>;
32-
}
34+
/** Common write methods for ES6 Map/Set. */
35+
export interface Collection<K> extends ReadonlyCollection<K> {
36+
delete(key: K): boolean;
37+
clear(): void;
38+
}
3339

34-
/** Common write methods for ES6 Map/Set. */
35-
export interface Collection<K> extends ReadonlyCollection<K> {
36-
delete(key: K): boolean;
37-
clear(): void;
38-
}
40+
/** ES6 Map interface, only read methods included. */
41+
export interface ReadonlyESMap<K, V> extends ReadonlyCollection<K> {
42+
get(key: K): V | undefined;
43+
values(): Iterator<V>;
44+
entries(): Iterator<[
45+
K,
46+
V
47+
]>;
48+
forEach(action: (value: V, key: K) => void): void;
49+
}
3950

40-
/** ES6 Map interface, only read methods included. */
41-
export interface ReadonlyESMap<K, V> extends ReadonlyCollection<K> {
42-
get(key: K): V | undefined;
43-
values(): Iterator<V>;
44-
entries(): Iterator<[
45-
K,
46-
V
47-
]>;
48-
forEach(action: (value: V, key: K) => void): void;
49-
}
51+
/**
52+
* ES6 Map interface, only read methods included.
53+
*/
54+
export interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
55+
}
5056

51-
/**
52-
* ES6 Map interface, only read methods included.
53-
*/
54-
export interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
55-
}
57+
/** ES6 Map interface. */
58+
export interface ESMap<K, V> extends ReadonlyESMap<K, V>, Collection<K> {
59+
set(key: K, value: V): this;
60+
}
5661

57-
/** ES6 Map interface. */
58-
export interface ESMap<K, V> extends ReadonlyESMap<K, V>, Collection<K> {
59-
set(key: K, value: V): this;
60-
}
62+
/**
63+
* ES6 Map interface.
64+
*/
65+
export interface Map<T> extends ESMap<string, T> {
66+
}
6167

62-
/**
63-
* ES6 Map interface.
64-
*/
65-
export interface Map<T> extends ESMap<string, T> {
66-
}
68+
/* @internal */
69+
export interface MapConstructor {
70+
// eslint-disable-next-line @typescript-eslint/prefer-function-type
71+
new <K, V>(iterable?: readonly (readonly [
72+
K,
73+
V
74+
])[] | ReadonlyESMap<K, V>): ESMap<K, V>;
75+
}
6776

68-
/* @internal */
69-
export interface MapConstructor {
70-
// eslint-disable-next-line @typescript-eslint/prefer-function-type
71-
new <K, V>(iterable?: readonly (readonly [
72-
K,
73-
V
74-
])[] | ReadonlyESMap<K, V>): ESMap<K, V>;
75-
}
77+
/** ES6 Set interface, only read methods included. */
78+
export interface ReadonlySet<T> extends ReadonlyCollection<T> {
79+
has(value: T): boolean;
80+
values(): Iterator<T>;
81+
entries(): Iterator<[
82+
T,
83+
T
84+
]>;
85+
forEach(action: (value: T, key: T) => void): void;
86+
}
7687

77-
/** ES6 Set interface, only read methods included. */
78-
export interface ReadonlySet<T> extends ReadonlyCollection<T> {
79-
has(value: T): boolean;
80-
values(): Iterator<T>;
81-
entries(): Iterator<[
82-
T,
83-
T
84-
]>;
85-
forEach(action: (value: T, key: T) => void): void;
86-
}
88+
/** ES6 Set interface. */
89+
export interface Set<T> extends ReadonlySet<T>, Collection<T> {
90+
add(value: T): this;
91+
delete(value: T): boolean;
92+
}
8793

88-
/** ES6 Set interface. */
89-
export interface Set<T> extends ReadonlySet<T>, Collection<T> {
90-
add(value: T): this;
91-
delete(value: T): boolean;
92-
}
94+
/* @internal */
95+
export interface SetConstructor {
96+
// eslint-disable-next-line @typescript-eslint/prefer-function-type
97+
new <T>(iterable?: readonly T[] | ReadonlySet<T>): Set<T>;
98+
}
9399

94-
/* @internal */
95-
export interface SetConstructor {
96-
// eslint-disable-next-line @typescript-eslint/prefer-function-type
97-
new <T>(iterable?: readonly T[] | ReadonlySet<T>): Set<T>;
98-
}
100+
/** ES6 Iterator type. */
101+
export interface Iterator<T> {
102+
next(): {
103+
value: T;
104+
done?: false;
105+
} | {
106+
value: void;
107+
done: true;
108+
};
109+
}
99110

100-
/** ES6 Iterator type. */
101-
export interface Iterator<T> {
102-
next(): {
103-
value: T;
104-
done?: false;
105-
} | {
106-
value: void;
107-
done: true;
108-
};
109-
}
111+
/** Array that is only intended to be pushed to, never read. */
112+
export interface Push<T> {
113+
push(...values: T[]): void;
114+
/* @internal*/ readonly length: number;
115+
}
110116

111-
/** Array that is only intended to be pushed to, never read. */
112-
export interface Push<T> {
113-
push(...values: T[]): void;
114-
/* @internal*/ readonly length: number;
115-
}
117+
/* @internal */
118+
export type EqualityComparer<T> = (a: T, b: T) => boolean;
116119

117-
/* @internal */
118-
export type EqualityComparer<T> = (a: T, b: T) => boolean;
120+
/* @internal */
121+
export type Comparer<T> = (a: T, b: T) => Comparison;
119122

120-
/* @internal */
121-
export type Comparer<T> = (a: T, b: T) => Comparison;
123+
/* @internal */
124+
export const enum Comparison {
125+
LessThan = -1,
126+
EqualTo = 0,
127+
GreaterThan = 1
128+
}
122129

123-
/* @internal */
124-
export const enum Comparison {
125-
LessThan = -1,
126-
EqualTo = 0,
127-
GreaterThan = 1
128-
}
130+
/* @internal */
131+
namespace NativeCollections {
132+
declare const self: any;
129133

130-
/* @internal */
131-
namespace NativeCollections {
132-
declare const self: any;
133-
134-
const globals = typeof globalThis !== "undefined" ? globalThis :
135-
typeof global !== "undefined" ? global :
136-
typeof self !== "undefined" ? self :
137-
undefined;
138-
139-
/**
140-
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
141-
*/
142-
export function tryGetNativeMap(): MapConstructor | undefined {
143-
// Internet Explorer's Map doesn't support iteration, so don't use it.
144-
const gMap = globals?.Map;
145-
// eslint-disable-next-line no-in-operator
146-
return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
147-
}
148-
149-
/**
150-
* Returns the native Set implementation if it is available and compatible (i.e. supports iteration).
151-
*/
152-
export function tryGetNativeSet(): SetConstructor | undefined {
153-
// Internet Explorer's Set doesn't support iteration, so don't use it.
154-
const gSet = globals?.Set;
155-
// eslint-disable-next-line no-in-operator
156-
return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
157-
}
158-
}
134+
const globals = typeof globalThis !== "undefined" ? globalThis :
135+
typeof global !== "undefined" ? global :
136+
typeof self !== "undefined" ? self :
137+
undefined;
159138

160-
/* @internal */
161-
export const Map = getCollectionImplementation("Map", "tryGetNativeMap", "createMapShim");
162-
/* @internal */
163-
export const Set = getCollectionImplementation("Set", "tryGetNativeSet", "createSetShim");
139+
/**
140+
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
141+
*/
142+
export function tryGetNativeMap(): MapConstructor | undefined {
143+
// Internet Explorer's Map doesn't support iteration, so don't use it.
144+
const gMap = globals?.Map;
145+
// eslint-disable-next-line no-in-operator
146+
return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
147+
}
164148

165-
/* @internal */
166-
type GetIteratorCallback = <I extends readonly any[] | ReadonlySet<any> | ReadonlyESMap<any, any> | undefined>(iterable: I) => Iterator<I extends ReadonlyESMap<infer K, infer V> ? [
167-
K,
168-
V
169-
] : I extends ReadonlySet<infer T> ? T : I extends readonly (infer T)[] ? T : I extends undefined ? undefined : never>;
170-
171-
/* @internal */
172-
function getCollectionImplementation<K1 extends ts.MatchingKeys<typeof NativeCollections, () => any>, K2 extends ts.MatchingKeys<typeof ts.ShimCollections, (getIterator?: GetIteratorCallback) => ReturnType<(typeof NativeCollections)[K1]>>>(name: string, nativeFactory: K1, shimFactory: K2): NonNullable<ReturnType<(typeof NativeCollections)[K1]>> {
173-
// NOTE: ts.ShimCollections will be defined for typescriptServices.js but not for tsc.js, so we must test for it.
174-
const constructor = NativeCollections[nativeFactory]() ?? ts.ShimCollections?.[shimFactory](ts.getIterator);
175-
if (constructor)
176-
return constructor as NonNullable<ReturnType<(typeof NativeCollections)[K1]>>;
177-
throw new Error(`TypeScript requires an environment that provides a compatible native ${name} implementation.`);
149+
/**
150+
* Returns the native Set implementation if it is available and compatible (i.e. supports iteration).
151+
*/
152+
export function tryGetNativeSet(): SetConstructor | undefined {
153+
// Internet Explorer's Set doesn't support iteration, so don't use it.
154+
const gSet = globals?.Set;
155+
// eslint-disable-next-line no-in-operator
156+
return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
178157
}
179158
}
159+
160+
/* @internal */
161+
export const Map = getCollectionImplementation("Map", "tryGetNativeMap", "createMapShim");
162+
/* @internal */
163+
export const Set = getCollectionImplementation("Set", "tryGetNativeSet", "createSetShim");
164+
165+
/* @internal */
166+
type GetIteratorCallback = <I extends readonly any[] | ReadonlySet<any> | ReadonlyESMap<any, any> | undefined>(iterable: I) => Iterator<I extends ReadonlyESMap<infer K, infer V> ? [
167+
K,
168+
V
169+
] : I extends ReadonlySet<infer T> ? T : I extends readonly (infer T)[] ? T : I extends undefined ? undefined : never>;
170+
171+
/* @internal */
172+
function getCollectionImplementation<K1 extends ts.MatchingKeys<typeof NativeCollections, () => any>, K2 extends ts.MatchingKeys<typeof ts.ShimCollections, (getIterator?: GetIteratorCallback) => ReturnType<(typeof NativeCollections)[K1]>>>(name: string, nativeFactory: K1, shimFactory: K2): NonNullable<ReturnType<(typeof NativeCollections)[K1]>> {
173+
// NOTE: ts.ShimCollections will be defined for typescriptServices.js but not for tsc.js, so we must test for it.
174+
const constructor = NativeCollections[nativeFactory]() ?? ts.ShimCollections?.[shimFactory](ts.getIterator);
175+
if (constructor)
176+
return constructor as NonNullable<ReturnType<(typeof NativeCollections)[K1]>>;
177+
throw new Error(`TypeScript requires an environment that provides a compatible native ${name} implementation.`);
178+
}
179+
}

0 commit comments

Comments
 (0)