MCPcopy Create free account
hub / github.com/TruthHun/BookStack / promiseFromYieldHandler

Function promiseFromYieldHandler

static/word2md/mammoth.browser.js:5997–6012  ·  view source on GitHub ↗
(value, yieldHandlers, traceParent)

Source from the content-addressed store, hash-verified

5995var yieldHandlers = [];
5996
5997function promiseFromYieldHandler(value, yieldHandlers, traceParent) {
5998 for (var i = 0; i < yieldHandlers.length; ++i) {
5999 traceParent._pushContext();
6000 var result = tryCatch(yieldHandlers[i])(value);
6001 traceParent._popContext();
6002 if (result === errorObj) {
6003 traceParent._pushContext();
6004 var ret = Promise.reject(errorObj.e);
6005 traceParent._popContext();
6006 return ret;
6007 }
6008 var maybePromise = tryConvertToPromise(result, traceParent);
6009 if (maybePromise instanceof Promise) return maybePromise;
6010 }
6011 return null;
6012}
6013
6014function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {
6015 if (debug.cancellation()) {

Callers 1

mammoth.browser.jsFile · 0.70

Calls 2

tryCatchFunction · 0.70
tryConvertToPromiseFunction · 0.70

Tested by

no test coverage detected