refactor(ivy): remove unused code from `TypeCheckContext` (#29209)

PR Close #29209
This commit is contained in:
George Kalpakas 2019-03-21 19:47:11 +02:00 committed by Miško Hevery
parent e185d3a4ad
commit 70fffba054
1 changed files with 0 additions and 13 deletions

View File

@ -28,11 +28,6 @@ import {generateTypeCtor} from './type_constructor';
export class TypeCheckContext { export class TypeCheckContext {
constructor(private refEmitter: ReferenceEmitter) {} constructor(private refEmitter: ReferenceEmitter) {}
/**
* A `Set` of classes which will be used to generate type constructors.
*/
private typeCtors = new Set<ts.ClassDeclaration>();
/** /**
* A `Map` of `ts.SourceFile`s that the context has seen to the operations (additions of methods * A `Map` of `ts.SourceFile`s that the context has seen to the operations (additions of methods
* or type-check blocks) that need to be eventually performed on that file. * or type-check blocks) that need to be eventually performed on that file.
@ -83,9 +78,6 @@ export class TypeCheckContext {
* Record a type constructor for the given `node` with the given `ctorMetadata`. * Record a type constructor for the given `node` with the given `ctorMetadata`.
*/ */
addTypeCtor(sf: ts.SourceFile, node: ts.ClassDeclaration, ctorMeta: TypeCtorMetadata): void { addTypeCtor(sf: ts.SourceFile, node: ts.ClassDeclaration, ctorMeta: TypeCtorMetadata): void {
if (this.hasTypeCtor(node)) {
return;
}
// Lazily construct the operation map. // Lazily construct the operation map.
if (!this.opMap.has(sf)) { if (!this.opMap.has(sf)) {
this.opMap.set(sf, []); this.opMap.set(sf, []);
@ -143,11 +135,6 @@ export class TypeCheckContext {
return ts.createSourceFile(sf.fileName, code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); return ts.createSourceFile(sf.fileName, code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
} }
/**
* Whether the given `node` has a type constructor already.
*/
private hasTypeCtor(node: ts.ClassDeclaration): boolean { return this.typeCtors.has(node); }
private addTypeCheckBlock( private addTypeCheckBlock(
sf: ts.SourceFile, node: ts.ClassDeclaration, tcbMeta: TypeCheckBlockMetadata): void { sf: ts.SourceFile, node: ts.ClassDeclaration, tcbMeta: TypeCheckBlockMetadata): void {
if (!this.opMap.has(sf)) { if (!this.opMap.has(sf)) {