MCPcopy Index your code
hub / github.com/angular/angular / findPromiseRejectionHandler

Function findPromiseRejectionHandler

packages/zone.js/lib/browser/browser.ts:301–317  ·  view source on GitHub ↗
(evtName: string)

Source from the content-addressed store, hash-verified

299 Zone.__load_patch('PromiseRejectionEvent', (global: any, Zone: ZoneType) => {
300 // handle unhandled promise rejection
301 function findPromiseRejectionHandler(evtName: string) {
302 return function (e: any) {
303 const eventTasks = findEventTasks(global, evtName);
304 eventTasks.forEach((eventTask) => {
305 // windows has added unhandledrejection event listener
306 // trigger the event listener
307 const PromiseRejectionEvent = global['PromiseRejectionEvent'];
308 if (PromiseRejectionEvent) {
309 const evt = new PromiseRejectionEvent(evtName, {
310 promise: e.promise,
311 reason: e.rejection,
312 });
313 eventTask.invoke(evt);
314 }
315 });
316 };
317 }
318
319 if (global['PromiseRejectionEvent']) {
320 (Zone as any)[zoneSymbol('unhandledPromiseRejectionHandler')] =

Callers 1

patchBrowserFunction · 0.85

Calls 3

findEventTasksFunction · 0.90
invokeMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…