MCPcopy Create free account
hub / github.com/angular/angular / __load_patch

Method __load_patch

packages/zone.js/lib/zone-impl.ts:811–826  ·  view source on GitHub ↗
(name: string, fn: PatchFn, ignoreDuplicate = false)

Source from the content-addressed store, hash-verified

809 }
810
811 static __load_patch(name: string, fn: PatchFn, ignoreDuplicate = false): void {
812 if (Object.hasOwn(patches, name)) {
813 // `checkDuplicate` option is defined from global variable
814 // so it works for all modules.
815 // `ignoreDuplicate` can work for the specified module
816 const checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true;
817 if (!ignoreDuplicate && checkDuplicate) {
818 throw Error('Already loaded patch: ' + name);
819 }
820 } else if (!global['__Zone_disable_' + name]) {
821 const perfName = 'Zone:' + name;
822 mark(perfName);
823 patches[name] = fn(global, ZoneImpl, _api);
824 performanceMeasure(perfName, perfName);
825 }
826 }
827
828 public get parent(): AmbientZone | null {
829 return this._parent;

Callers

nothing calls this directly

Calls 5

__symbol__Function · 0.85
ErrorInterface · 0.85
performanceMeasureFunction · 0.85
markFunction · 0.70
fnFunction · 0.50

Tested by

no test coverage detected