Skip to content

Commit

Permalink
refactor(core): remove class type check when clearing cache in deps t…
Browse files Browse the repository at this point in the history
…racker

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.
  • Loading branch information
pmvald committed Aug 29, 2023
1 parent 0b6aae8 commit 16b29c7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/core/src/render3/deps_tracker/deps_tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,8 @@ class DepsTracker implements DepsTrackerApi {

/** @override */
clearScopeCacheFor(type: Type<any>): void {
if (isNgModule(type)) {
this.ngModulesScopeCache.delete(type);
} else if (isComponent(type)) {
this.standaloneComponentsScopeCache.delete(type);
}
this.ngModulesScopeCache.delete(type as NgModuleType);
this.standaloneComponentsScopeCache.delete(type as ComponentType<any>);
}

/** @override */
Expand Down

0 comments on commit 16b29c7

Please sign in to comment.