MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / handleOwnThenable

Function handleOwnThenable

libraries/p5.js:299–311  ·  view source on GitHub ↗
(promise, thenable)

Source from the content-addressed store, hash-verified

297}
298
299function handleOwnThenable(promise, thenable) {
300 if (thenable._state === FULFILLED) {
301 fulfill(promise, thenable._result);
302 } else if (thenable._state === REJECTED) {
303 _reject(promise, thenable._result);
304 } else {
305 subscribe(thenable, undefined, function (value) {
306 return _resolve(promise, value);
307 }, function (reason) {
308 return _reject(promise, reason);
309 });
310 }
311}
312
313function handleMaybeThenable(promise, maybeThenable, then$$) {
314 if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {

Callers 1

handleMaybeThenableFunction · 0.85

Calls 4

fulfillFunction · 0.85
_rejectFunction · 0.85
subscribeFunction · 0.85
_resolveFunction · 0.85

Tested by

no test coverage detected