Skip to content

Commit

Permalink
CONVERSION STEP - inlineImports
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
jakebailey committed Aug 25, 2022
1 parent 3134381 commit f3766ee
Show file tree
Hide file tree
Showing 238 changed files with 58,899 additions and 55,910 deletions.
2,414 changes: 1,236 additions & 1,178 deletions src/compiler/binder.ts

Large diffs are not rendered by default.

653 changes: 334 additions & 319 deletions src/compiler/builder.ts

Large diffs are not rendered by default.

75 changes: 40 additions & 35 deletions src/compiler/builderPublic.ts

Large diffs are not rendered by default.

193 changes: 100 additions & 93 deletions src/compiler/builderState.ts

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/compiler/builderStatePublic.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as ts from "./_namespaces/ts";
import { BuildInfo, Diagnostic } from "./_namespaces/ts";

export interface EmitOutput {
outputFiles: OutputFile[];
emitSkipped: boolean;
/* @internal */ diagnostics: readonly ts.Diagnostic[];
/* @internal */ diagnostics: readonly Diagnostic[];
}

export interface OutputFile {
name: string;
writeByteOrderMark: boolean;
text: string;
/* @internal */ buildInfo?: ts.BuildInfo
/* @internal */ buildInfo?: BuildInfo
}
26,746 changes: 13,472 additions & 13,274 deletions src/compiler/checker.ts

Large diffs are not rendered by default.

1,649 changes: 835 additions & 814 deletions src/compiler/commandLineParser.ts

Large diffs are not rendered by default.

334 changes: 169 additions & 165 deletions src/compiler/core.ts

Large diffs are not rendered by default.

473 changes: 245 additions & 228 deletions src/compiler/debug.ts

Large diffs are not rendered by default.

3,296 changes: 1,687 additions & 1,609 deletions src/compiler/emitter.ts

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions src/compiler/factory/baseNodeFactory.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import * as ts from "../_namespaces/ts";
import { Node, objectAllocator, SyntaxKind } from "../_namespaces/ts";

/**
* A `BaseNodeFactory` is an abstraction over an `ObjectAllocator` that handles caching `Node` constructors
* and allocating `Node` instances based on a set of predefined types.
*/
/* @internal */
export interface BaseNodeFactory {
createBaseSourceFileNode(kind: ts.SyntaxKind): ts.Node;
createBaseIdentifierNode(kind: ts.SyntaxKind): ts.Node;
createBasePrivateIdentifierNode(kind: ts.SyntaxKind): ts.Node;
createBaseTokenNode(kind: ts.SyntaxKind): ts.Node;
createBaseNode(kind: ts.SyntaxKind): ts.Node;
createBaseSourceFileNode(kind: SyntaxKind): Node;
createBaseIdentifierNode(kind: SyntaxKind): Node;
createBasePrivateIdentifierNode(kind: SyntaxKind): Node;
createBaseTokenNode(kind: SyntaxKind): Node;
createBaseNode(kind: SyntaxKind): Node;
}

/* @internal */
Expand All @@ -19,11 +19,11 @@ export interface BaseNodeFactory {
*/
export function createBaseNodeFactory(): BaseNodeFactory {
// tslint:disable variable-name
let NodeConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
let TokenConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
let IdentifierConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
let PrivateIdentifierConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
let SourceFileConstructor: new (kind: ts.SyntaxKind, pos?: number, end?: number) => ts.Node;
let NodeConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
let TokenConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
let IdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
let PrivateIdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
let SourceFileConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
// tslint:enable variable-name

return {
Expand All @@ -34,23 +34,23 @@ export function createBaseNodeFactory(): BaseNodeFactory {
createBaseNode
};

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

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

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

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

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

0 comments on commit f3766ee

Please sign in to comment.