Skip to content

Commit d0e4481

Browse files
committed
Generated module 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 b48ab3d commit d0e4481

File tree

240 files changed

+59371
-56342
lines changed

Some content is hidden

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

240 files changed

+59371
-56342
lines changed

Diff for: src/compiler/binder.ts

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

Diff for: src/compiler/builder.ts

+337-322
Large diffs are not rendered by default.

Diff for: src/compiler/builderPublic.ts

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

Diff for: src/compiler/builderState.ts

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

Diff for: 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
}

Diff for: src/compiler/checker.ts

+13,529-13,331
Large diffs are not rendered by default.

Diff for: src/compiler/commandLineParser.ts

+845-824
Large diffs are not rendered by default.

Diff for: src/compiler/core.ts

+171-167
Large diffs are not rendered by default.

Diff for: src/compiler/debug.ts

+247-230
Large diffs are not rendered by default.

Diff for: src/compiler/emitter.ts

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

Diff for: src/compiler/factory/baseNodeFactory.ts

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
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 */
1717
/**
1818
* Creates a `BaseNodeFactory` which can be used to create `Node` instances from the constructors provided by the object allocator.
1919
*/
2020
export function createBaseNodeFactory(): BaseNodeFactory {
21-
let NodeConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
22-
let TokenConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
23-
let IdentifierConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
24-
let PrivateIdentifierConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
25-
let SourceFileConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
21+
let NodeConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
22+
let TokenConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
23+
let IdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
24+
let PrivateIdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
25+
let SourceFileConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
2626

2727
return {
2828
createBaseSourceFileNode,
@@ -32,23 +32,23 @@ export function createBaseNodeFactory(): BaseNodeFactory {
3232
createBaseNode
3333
};
3434

35-
function createBaseSourceFileNode(kind: ts.SyntaxKind): ts.Node {
36-
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
35+
function createBaseSourceFileNode(kind: SyntaxKind): Node {
36+
return new (SourceFileConstructor || (SourceFileConstructor = objectAllocator.getSourceFileConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
3737
}
3838

39-
function createBaseIdentifierNode(kind: ts.SyntaxKind): ts.Node {
40-
return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
39+
function createBaseIdentifierNode(kind: SyntaxKind): Node {
40+
return new (IdentifierConstructor || (IdentifierConstructor = objectAllocator.getIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
4141
}
4242

43-
function createBasePrivateIdentifierNode(kind: ts.SyntaxKind): ts.Node {
44-
return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = ts.objectAllocator.getPrivateIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
43+
function createBasePrivateIdentifierNode(kind: SyntaxKind): Node {
44+
return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = objectAllocator.getPrivateIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
4545
}
4646

47-
function createBaseTokenNode(kind: ts.SyntaxKind): ts.Node {
48-
return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
47+
function createBaseTokenNode(kind: SyntaxKind): Node {
48+
return new (TokenConstructor || (TokenConstructor = objectAllocator.getTokenConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
4949
}
5050

51-
function createBaseNode(kind: ts.SyntaxKind): ts.Node {
52-
return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
51+
function createBaseNode(kind: SyntaxKind): Node {
52+
return new (NodeConstructor || (NodeConstructor = objectAllocator.getNodeConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
5353
}
5454
}

0 commit comments

Comments
 (0)