From 6c7e1e61c69959f86dc856a4e0b63f8fc8ea3b2c Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Thu, 7 Dec 2023 17:28:13 -0800 Subject: [PATCH] refactor(zone.js): export Zone initialization function instead of invoking it as an IIFE (#53443) This removes the top-level side effects from this file. Indenting is left as-is to minimize changes. PR Close #53443 --- packages/zone.js/lib/zone-impl.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/zone.js/lib/zone-impl.ts b/packages/zone.js/lib/zone-impl.ts index 73ebe43d94f..545c2c2d54e 100644 --- a/packages/zone.js/lib/zone-impl.ts +++ b/packages/zone.js/lib/zone-impl.ts @@ -676,7 +676,7 @@ export type AmbientZone = Zone; // Initialize global `Zone` constant. const global = globalThis as any; -(function() { +export function initZone(): ZoneType { const performance: {mark(name: string): void; measure(name: string, label: string): void;} = global['performance']; function mark(name: string) { @@ -1448,7 +1448,5 @@ let _numberOfNestedTaskFrames = 0; function noop() {} performanceMeasure('Zone', 'Zone'); -return global['Zone'] = ZoneImpl; -})(); - -export {}; +return ZoneImpl; +}