Skip to content

Commit

Permalink
refactor(core): set up framework injector profile exclusively when `W…
Browse files Browse the repository at this point in the history
…eakRef` is defined

In some cases in G3 `WeakRef` is undefined because some tests are executed on older unsupported browsers.
  • Loading branch information
alan-agius4 committed Apr 23, 2024
1 parent a23cb10 commit 82e7b20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/render3/util/global_utils.ts
Expand Up @@ -71,8 +71,9 @@ export function publishDefaultGlobalUtils() {
if (!_published) {
_published = true;

if (typeof window !== 'undefined') {
// Only configure the injector profiler when running in the browser.
// Only configure the injector profiler when running in the browser and WeakRef is defined.
// In some G3 tests WeakRef is undefined as they user older (unsupported) browsers to test.
if (typeof window !== 'undefined' && typeof WeakRef !== 'undefined') {
setupFrameworkInjectorProfiler();
}

Expand Down

0 comments on commit 82e7b20

Please sign in to comment.