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

Function autoProxyFn

packages/zone.js/lib/zone-spec/fake-async-test.ts:1076–1087  ·  view source on GitHub ↗
(this: unknown, ...args: any[])

Source from the content-addressed store, hash-verified

1074 */
1075export function withProxyZone<T extends Function>(fn: T): T {
1076 const autoProxyFn: any = function (this: unknown, ...args: any[]) {
1077 const proxyZoneSpec = getProxyZoneSpec();
1078 if (proxyZoneSpec === undefined) {
1079 throw new Error(
1080 'ProxyZoneSpec is needed for the withProxyZone() test helper but could not be found. ' +
1081 'Make sure that your environment includes zone-testing.js',
1082 );
1083 }
1084
1085 const proxyZone = proxyZoneSpec.get() !== undefined ? Zone.current : getOrCreateRootProxy();
1086 return proxyZone.run(fn, this, args);
1087 };
1088 return autoProxyFn as T;
1089}
1090

Callers

nothing calls this directly

Calls 4

getProxyZoneSpecFunction · 0.85
getOrCreateRootProxyFunction · 0.85
getMethod · 0.65
runMethod · 0.65

Tested by

no test coverage detected