MCPcopy Create free account
hub / github.com/microsoft/SandDance / maybeInvokeDelegate

Function maybeInvokeDelegate

docs/app/js/sanddance-app.js:53279–53292  ·  view source on GitHub ↗
(delegate, context)

Source from the content-addressed store, hash-verified

53277 };
53278 }
53279 function maybeInvokeDelegate(delegate, context) {
53280 var method = delegate.iterator[context.method];
53281 if (undefined === method) {
53282 if (context.delegate = null, "throw" === context.method) {
53283 if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
53284 context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
53285 }
53286 return ContinueSentinel;
53287 }
53288 var record = tryCatch(method, delegate.iterator, context.arg);
53289 if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
53290 var info = record.arg;
53291 return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
53292 }
53293 function pushTryEntry(locs) {
53294 var entry = {
53295 tryLoc: locs[0]

Callers 1

wrapFunction · 0.70

Calls 1

tryCatchFunction · 0.70

Tested by

no test coverage detected