Skip to content

Commit 456b986

Browse files
committed
CONVERSION STEP - inlineImports
This step converts as many explicit accesses as possible in favor of direct imports from the modules in which things were declared. This restores the code (as much as possible) back to how it looked originally before the explicitify step, e.g. instead of "ts.Node" and "ts.Symbol", we have just "Node" and "Symbol".
1 parent 0a9a102 commit 456b986

File tree

238 files changed

+58954
-55962
lines changed

Some content is hidden

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

238 files changed

+58954
-55962
lines changed

src/compiler/binder.ts

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

src/compiler/builder.ts

+334-319
Large diffs are not rendered by default.

src/compiler/builderPublic.ts

+40-35
Large diffs are not rendered by default.

src/compiler/builderState.ts

+100-93
Large diffs are not rendered by default.

src/compiler/builderStatePublic.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import * as ts from "./_namespaces/ts";
1+
import { BuildInfo, Diagnostic } from "./_namespaces/ts";
22

33
export interface EmitOutput {
44
outputFiles: OutputFile[];
55
emitSkipped: boolean;
6-
/* @internal */ diagnostics: readonly ts.Diagnostic[];
6+
/* @internal */ diagnostics: readonly Diagnostic[];
77
}
88

99
export interface OutputFile {
1010
name: string;
1111
writeByteOrderMark: boolean;
1212
text: string;
13-
/* @internal */ buildInfo?: ts.BuildInfo
13+
/* @internal */ buildInfo?: BuildInfo
1414
}

src/compiler/checker.ts

+13,483-13,284
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

+835-814
Large diffs are not rendered by default.

src/compiler/core.ts

+169-165
Large diffs are not rendered by default.

src/compiler/debug.ts

+245-228
Large diffs are not rendered by default.

src/compiler/emitter.ts

+1,690-1,612
Large diffs are not rendered by default.
+21-21
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import * as ts from "../_namespaces/ts";
1+
import { Node, objectAllocator, SyntaxKind } from "../_namespaces/ts";
22

33
/**
44
* A `BaseNodeFactory` is an abstraction over an `ObjectAllocator` that handles caching `Node` constructors
55
* and allocating `Node` instances based on a set of predefined types.
66
*/
77
/* @internal */
88
export interface BaseNodeFactory {
9-
createBaseSourceFileNode(kind: ts.SyntaxKind): ts.Node;
10-
createBaseIdentifierNode(kind: ts.SyntaxKind): ts.Node;
11-
createBasePrivateIdentifierNode(kind: ts.SyntaxKind): ts.Node;
12-
createBaseTokenNode(kind: ts.SyntaxKind): ts.Node;
13-
createBaseNode(kind: ts.SyntaxKind): ts.Node;
9+
createBaseSourceFileNode(kind: SyntaxKind): Node;
10+
createBaseIdentifierNode(kind: SyntaxKind): Node;
11+
createBasePrivateIdentifierNode(kind: SyntaxKind): Node;
12+
createBaseTokenNode(kind: SyntaxKind): Node;
13+
createBaseNode(kind: SyntaxKind): Node;
1414
}
1515

1616
/** @internal */
@@ -19,11 +19,11 @@ export interface BaseNodeFactory {
1919
*/
2020
export function createBaseNodeFactory(): BaseNodeFactory {
2121
// tslint:disable variable-name
22-
let NodeConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
23-
let TokenConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
24-
let IdentifierConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
25-
let PrivateIdentifierConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
26-
let SourceFileConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
22+
let NodeConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
23+
let TokenConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
24+
let IdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
25+
let PrivateIdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
26+
let SourceFileConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
2727
// tslint:enable variable-name
2828

2929
return {
@@ -34,23 +34,23 @@ export function createBaseNodeFactory(): BaseNodeFactory {
3434
createBaseNode
3535
};
3636

37-
function createBaseSourceFileNode(kind: ts.SyntaxKind): ts.Node {
38-
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
37+
function createBaseSourceFileNode(kind: SyntaxKind): Node {
38+
return new (SourceFileConstructor || (SourceFileConstructor = objectAllocator.getSourceFileConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
3939
}
4040

41-
function createBaseIdentifierNode(kind: ts.SyntaxKind): ts.Node {
42-
return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
41+
function createBaseIdentifierNode(kind: SyntaxKind): Node {
42+
return new (IdentifierConstructor || (IdentifierConstructor = objectAllocator.getIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
4343
}
4444

45-
function createBasePrivateIdentifierNode(kind: ts.SyntaxKind): ts.Node {
46-
return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = ts.objectAllocator.getPrivateIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
45+
function createBasePrivateIdentifierNode(kind: SyntaxKind): Node {
46+
return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = objectAllocator.getPrivateIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
4747
}
4848

49-
function createBaseTokenNode(kind: ts.SyntaxKind): ts.Node {
50-
return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
49+
function createBaseTokenNode(kind: SyntaxKind): Node {
50+
return new (TokenConstructor || (TokenConstructor = objectAllocator.getTokenConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
5151
}
5252

53-
function createBaseNode(kind: ts.SyntaxKind): ts.Node {
54-
return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
53+
function createBaseNode(kind: SyntaxKind): Node {
54+
return new (NodeConstructor || (NodeConstructor = objectAllocator.getNodeConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
5555
}
5656
}

0 commit comments

Comments
 (0)