From 88096a30b093b60c03ce8c00821dac8a0c04e920 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 28 Aug 2018 11:21:35 -0700 Subject: [PATCH] renames per PR feedback --- src/compiler/tsbuild.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index e1b2ffb0dde..32b10569fc6 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -38,7 +38,7 @@ namespace ts { invalidateProject(project: ResolvedConfigFileName, dependencyGraph: DependencyGraph | undefined): void; getNextInvalidatedProject(): ResolvedConfigFileName | undefined; - pendingInvalidatedProjects(): boolean; + hasPendingInvalidatedProjects(): boolean; missingRoots: Map; } @@ -395,20 +395,21 @@ namespace ts { unchangedOutputs: createFileMap(), invalidateProject, getNextInvalidatedProject, - pendingInvalidatedProjects, + hasPendingInvalidatedProjects, missingRoots }; - function invalidateProject(proj: ResolvedConfigFileName, dependancyGraph: DependencyGraph | undefined) { + function invalidateProject(proj: ResolvedConfigFileName, dependencyGraph: DependencyGraph | undefined) { if (!projectPendingBuild.hasKey(proj)) { addProjToQueue(proj); - if (dependancyGraph) { - queueBuildForDownstreamReferences(proj, dependancyGraph); + if (dependencyGraph) { + queueBuildForDownstreamReferences(proj, dependencyGraph); } } } function addProjToQueue(proj: ResolvedConfigFileName) { + Debug.assert(!projectPendingBuild.hasKey(proj)); projectPendingBuild.setValue(proj, true); invalidatedProjectQueue.push(proj); } @@ -425,18 +426,18 @@ namespace ts { } } - function pendingInvalidatedProjects() { + function hasPendingInvalidatedProjects() { return !!projectPendingBuild.getSize(); } // Mark all downstream projects of this one needing to be built "later" - function queueBuildForDownstreamReferences(root: ResolvedConfigFileName, dependancyGraph: DependencyGraph) { - const deps = dependancyGraph.dependencyMap.getReferencesTo(root); + function queueBuildForDownstreamReferences(root: ResolvedConfigFileName, dependencyGraph: DependencyGraph) { + const deps = dependencyGraph.dependencyMap.getReferencesTo(root); for (const ref of deps) { // Can skip circular references if (!projectPendingBuild.hasKey(ref)) { addProjToQueue(ref); - queueBuildForDownstreamReferences(ref, dependancyGraph); + queueBuildForDownstreamReferences(ref, dependencyGraph); } } } @@ -809,7 +810,7 @@ namespace ts { timerToBuildInvalidatedProject = undefined; const buildProject = context.getNextInvalidatedProject(); buildSomeProjects(p => p === buildProject); - if (context.pendingInvalidatedProjects()) { + if (context.hasPendingInvalidatedProjects()) { if (!timerToBuildInvalidatedProject) { scheduleBuildInvalidatedProject(); }