MCPcopy
hub / github.com/rollup/rollup / onUnhandled

Function onUnhandled

test/form/samples/supports-core-js/_expected.js:11023–11040  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

11021 };
11022
11023 var onUnhandled = function (state) {
11024 call(task, globalThis, function () {
11025 var promise = state.facade;
11026 var value = state.value;
11027 var IS_UNHANDLED = isUnhandled(state);
11028 var result;
11029 if (IS_UNHANDLED) {
11030 result = perform(function () {
11031 if (IS_NODE) {
11032 process.emit('unhandledRejection', value, promise);
11033 } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
11034 });
11035 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
11036 state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
11037 if (result.error) throw result.value;
11038 }
11039 });
11040 };
11041
11042 var isUnhandled = function (state) {
11043 return state.rejection !== HANDLED && !state.parent;

Callers 1

notifyFunction · 0.85

Calls 3

isUnhandledFunction · 0.85
dispatchEventFunction · 0.85
emitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…