Skip to content

Commit

Permalink
Fix problem where some declarations would get cache-invalidated incor…
Browse files Browse the repository at this point in the history
…rectly
  • Loading branch information
runem committed Jul 14, 2020
1 parent 5146284 commit 1fd0fa1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/analyze/stages/analyze-declaration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Node } from "typescript";
import { Node, Path } from "typescript";
import { AnalyzerVisitContext } from "../analyzer-visit-context";
import { AnalyzerDeclarationVisitContext, ComponentFeatureCollection } from "../flavors/analyzer-flavor";
import { ComponentDeclaration } from "../types/component-declaration";
Expand Down Expand Up @@ -173,6 +173,7 @@ function shouldInvalidateCachedDeclaration(componentDeclaration: ComponentDeclar
// By doing "node.getSourceFile()" we get an possible updated source file reference.
// Therefore this is a nested WeakMap looking up SourceFile and then the Node
const node = heritageClause.declaration.node;
context.program.getSourceFileByPath(node.getSourceFile().fileName as Path);
const sourceFile = node.getSourceFile();
const foundInCache = context.cache.componentDeclarationInSourceFile.get(sourceFile)?.has(node) ?? false;

Expand Down

0 comments on commit 1fd0fa1

Please sign in to comment.