Skip to content

Commit 3212c1e

Browse files
committed
Move internal comments around all day
1 parent 73bb89f commit 3212c1e

5 files changed

Lines changed: 35 additions & 22 deletions

File tree

src/compiler/core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ namespace ts {
5555
/* @internal */
5656
export type Comparer<T> = (a: T, b: T) => Comparison;
5757

58+
/* @internal */
5859
export const enum Comparison {
5960
LessThan = -1,
6061
EqualTo = 0,

src/compiler/tsbuild.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ namespace ts {
245245
}
246246
}
247247

248-
export function createDependencyMapper() {
248+
function createDependencyMapper() {
249249
const childToParents = createFileMap<ResolvedConfigFileName[]>();
250250
const parentToChildren = createFileMap<ResolvedConfigFileName[]>();
251251
const allKeys = createFileMap<true>();
@@ -422,7 +422,7 @@ namespace ts {
422422
}
423423
];
424424

425-
export function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number {
425+
export function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined {
426426
let verbose = false;
427427
let dry = false;
428428
let force = false;
@@ -489,15 +489,14 @@ namespace ts {
489489
if (clean) {
490490
return builder.cleanAllProjects();
491491
}
492-
else {
493-
return builder.buildAllProjects();
494-
}
495492

496493
if (watch) {
497494
builder.startWatching();
498-
return ExitStatus.Success;
495+
return undefined;
499496
}
500497

498+
return builder.buildAllProjects();
499+
501500
function addProject(projectSpecification: string) {
502501
const fileName = resolvePath(compilerHost.getCurrentDirectory(), projectSpecification);
503502
const refPath = resolveProjectReferencePath(compilerHost, { path: fileName });

src/compiler/utilities.ts

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
/** Non-internal stuff goes here */
22
namespace ts {
3-
export const emptyArray: never[] = [] as never[];
4-
export function closeFileWatcher(watcher: FileWatcher) {
5-
watcher.close();
6-
}
7-
83
export function isExternalModuleNameRelative(moduleName: string): boolean {
94
// TypeScript 1.0 spec (April 2014): 11.2.1
105
// An external module name is "relative" if the first term is "." or "..".
@@ -15,21 +10,11 @@ namespace ts {
1510
export function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: ReadonlyArray<T>): T[] {
1611
return sortAndDeduplicate<T>(diagnostics, compareDiagnostics);
1712
}
18-
19-
export function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path {
20-
const nonCanonicalizedPath = isRootedDiskPath(fileName)
21-
? normalizePath(fileName)
22-
: getNormalizedAbsolutePath(fileName, basePath);
23-
return <Path>getCanonicalFileName(nonCanonicalizedPath);
24-
}
25-
26-
export function hasEntries(map: ReadonlyUnderscoreEscapedMap<any> | undefined): map is ReadonlyUnderscoreEscapedMap<any> {
27-
return !!map && !!map.size;
28-
}
2913
}
3014

3115
/* @internal */
3216
namespace ts {
17+
export const emptyArray: never[] = [] as never[];
3318
export const resolvingEmptyArray: never[] = [] as never[];
3419
export const emptyMap: ReadonlyMap<never> = createMap<never>();
3520
export const emptyUnderscoreEscapedMap: ReadonlyUnderscoreEscapedMap<never> = emptyMap as ReadonlyUnderscoreEscapedMap<never>;
@@ -54,6 +39,10 @@ namespace ts {
5439
return new MapCtr<T>() as UnderscoreEscapedMap<T>;
5540
}
5641

42+
export function hasEntries(map: ReadonlyUnderscoreEscapedMap<any> | undefined): map is ReadonlyUnderscoreEscapedMap<any> {
43+
return !!map && !!map.size;
44+
}
45+
5746
export function createSymbolTable(symbols?: ReadonlyArray<Symbol>): SymbolTable {
5847
const result = createMap<Symbol>() as SymbolTable;
5948
if (symbols) {
@@ -103,6 +92,13 @@ namespace ts {
10392
};
10493
}
10594

95+
export function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path {
96+
const nonCanonicalizedPath = isRootedDiskPath(fileName)
97+
? normalizePath(fileName)
98+
: getNormalizedAbsolutePath(fileName, basePath);
99+
return <Path>getCanonicalFileName(nonCanonicalizedPath);
100+
}
101+
106102
export function changesAffectModuleResolution(oldOptions: CompilerOptions, newOptions: CompilerOptions): boolean {
107103
return !oldOptions ||
108104
(oldOptions.module !== newOptions.module) ||
@@ -4089,6 +4085,10 @@ namespace ts {
40894085
return options.watch && options.hasOwnProperty("watch");
40904086
}
40914087

4088+
export function closeFileWatcher(watcher: FileWatcher) {
4089+
watcher.close();
4090+
}
4091+
40924092
export function getCheckFlags(symbol: Symbol): CheckFlags {
40934093
return symbol.flags & SymbolFlags.Transient ? (<TransientSymbol>symbol).checkFlags : 0;
40944094
}
@@ -6647,7 +6647,11 @@ namespace ts {
66476647
export function isStringLiteralLike(node: Node): node is StringLiteralLike {
66486648
return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral;
66496649
}
6650+
}
66506651

6652+
6653+
/* @internal */
6654+
namespace ts {
66516655
/** @internal */
66526656
export function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports {
66536657
return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports;
@@ -6712,6 +6716,7 @@ namespace ts {
67126716
getSourceMapSourceConstructor: () => <any>SourceMapSource,
67136717
};
67146718

6719+
/* @internal */
67156720
export function formatStringFromArgs(text: string, args: ArrayLike<string>, baseIndex = 0): string {
67166721
return text.replace(/{(\d+)}/g, (_match, index: string) => Debug.assertDefined(args[+index + baseIndex]));
67176722
}
@@ -6722,6 +6727,7 @@ namespace ts {
67226727
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
67236728
}
67246729

6730+
/* @internal */
67256731
export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticWithLocation;
67266732
export function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage): DiagnosticWithLocation {
67276733
Debug.assertGreaterThanOrEqual(start, 0);
@@ -6761,6 +6767,7 @@ namespace ts {
67616767
return text;
67626768
}
67636769

6770+
/* @internal */
67646771
export function createCompilerDiagnostic(message: DiagnosticMessage, ...args: (string | number | undefined)[]): Diagnostic;
67656772
export function createCompilerDiagnostic(message: DiagnosticMessage): Diagnostic {
67666773
let text = getLocaleSpecificMessage(message);
@@ -6781,6 +6788,7 @@ namespace ts {
67816788
};
67826789
}
67836790

6791+
/* @internal */
67846792
export function createCompilerDiagnosticFromMessageChain(chain: DiagnosticMessageChain): Diagnostic {
67856793
return {
67866794
file: undefined,
@@ -6793,6 +6801,7 @@ namespace ts {
67936801
};
67946802
}
67956803

6804+
/* @internal */
67966805
export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage, ...args: (string | undefined)[]): DiagnosticMessageChain;
67976806
export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage): DiagnosticMessageChain {
67986807
let text = getLocaleSpecificMessage(message);
@@ -6824,6 +6833,7 @@ namespace ts {
68246833
return diagnostic.file ? diagnostic.file.path : undefined;
68256834
}
68266835

6836+
/* @internal */
68276837
export function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): Comparison {
68286838
return compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) ||
68296839
compareValues(d1.start, d2.start) ||
@@ -7122,6 +7132,7 @@ namespace ts {
71227132
return rootLength > 0 && rootLength === path.length;
71237133
}
71247134

7135+
/* @internal */
71257136
export function convertToRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string {
71267137
return !isRootedDiskPath(absoluteOrRelativePath)
71277138
? absoluteOrRelativePath

src/jsTyping/shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* @internal */
12
namespace ts.server {
23
// tslint:disable variable-name
34
export const ActionSet: ActionSet = "action::set";

src/jsTyping/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* @internal */
12
declare namespace ts.server {
23
export type ActionSet = "action::set";
34
export type ActionInvalidate = "action::invalidate";

0 commit comments

Comments
 (0)