Skip to content

Commit a9f609e

Browse files
pmvaldpkozlowski-opensource
authored andcommitted
refactor(core): remove class type check when clearing cache in deps tracker (angular#51293)
Using verification helpers such as `isComponent` may trigger JIT compilation. Now in some tests such compilation is made purposely to fail, and so in such cases any reference to the `depsTracker.clearScopeCacheFor` method will cause the exception to be thrown earlier than expected which results in teh test failure. Such scenario is the case in the next commit when we enable using the deps tracker in the jit compilation. Note that such failure is only for the framework tests and is a very edge case. The tests in downstream apps will not lead to such scenario of failure at all. PR Close angular#51293
1 parent f14d0d7 commit a9f609e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

packages/core/src/render3/deps_tracker/deps_tracker.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,8 @@ class DepsTracker implements DepsTrackerApi {
124124

125125
/** @override */
126126
clearScopeCacheFor(type: Type<any>): void {
127-
if (isNgModule(type)) {
128-
this.ngModulesScopeCache.delete(type);
129-
} else if (isComponent(type)) {
130-
this.standaloneComponentsScopeCache.delete(type);
131-
}
127+
this.ngModulesScopeCache.delete(type as NgModuleType);
128+
this.standaloneComponentsScopeCache.delete(type as ComponentType<any>);
132129
}
133130

134131
/** @override */

0 commit comments

Comments
 (0)