Lines Matching refs:promise

109 function promiseRejectHandler(type, promise, reason) {
115 unhandledRejection(promise, reason);
118 handledRejection(promise);
121 resolveError('resolve', promise, reason);
124 resolveError('reject', promise, reason);
134 function resolveError(type, promise, reason) {
136 // the executed promise.
138 if (process.emit('multipleResolves', type, promise, reason)) {
144 function unhandledRejection(promise, reason) {
145 const emit = (reason, promise, promiseInfo) => {
149 return process.emit('unhandledRejection', reason, promise);
152 maybeUnhandledPromises.set(promise, {
159 // This causes the promise to be referenced at least for one tick.
160 ArrayPrototypePush(pendingUnhandledRejections, promise);
164 function handledRejection(promise) {
165 const promiseInfo = maybeUnhandledPromises.get(promise);
167 maybeUnhandledPromises.delete(promise);
176 ArrayPrototypePush(asyncHandledRejections, { promise, warning });
189 'Unhandled promise rejection. This error originated either by ' +
191 'or by rejecting a promise which was not handled with .catch(). ' +
192 'To terminate the node process on unhandled promise ' +
224 const { promise, warning } = ArrayPrototypeShift(asyncHandledRejections);
225 if (!process.emit('rejectionHandled', promise)) {
232 const promise = ArrayPrototypeShift(pendingUnhandledRejections);
233 const promiseInfo = maybeUnhandledPromises.get(promise);
244 } = promise;
252 promise,
264 promise[kAsyncIdSymbol],
265 promise[kTriggerAsyncIdSymbol],
266 promise,
269 const handled = emit(reason, promise, promiseInfo);
274 emit(reason, promise, promiseInfo);
278 emit(reason, promise, promiseInfo);
283 const handled = emit(reason, promise, promiseInfo);
294 const handled = emit(reason, promise, promiseInfo);
336 'or by rejecting a promise which was not handled with .catch().' +
337 ' The promise rejected with the reason ' +