MCPcopy Index your code
hub / github.com/microsoft/SandDance / __asyncGenerator

Function __asyncGenerator

docs/app/js/sanddance-app.js:20387–20424  ·  view source on GitHub ↗
(thisArg, _arguments, generator)

Source from the content-addressed store, hash-verified

20385 return this instanceof __await ? (this.v = v, this) : new __await(v);
20386}
20387function __asyncGenerator(thisArg, _arguments, generator) {
20388 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
20389 var g = generator.apply(thisArg, _arguments || []), i, q = [];
20390 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
20391 return this;
20392 }, i;
20393 function verb(n) {
20394 if (g[n]) i[n] = function(v) {
20395 return new Promise(function(a, b) {
20396 q.push([
20397 n,
20398 v,
20399 a,
20400 b
20401 ]) > 1 || resume(n, v);
20402 });
20403 };
20404 }
20405 function resume(n, v) {
20406 try {
20407 step(g[n](v));
20408 } catch (e) {
20409 settle(q[0][3], e);
20410 }
20411 }
20412 function step(r) {
20413 r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
20414 }
20415 function fulfill(value) {
20416 resume("next", value);
20417 }
20418 function reject(value) {
20419 resume("throw", value);
20420 }
20421 function settle(f, v) {
20422 if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
20423 }
20424}
20425function __asyncDelegator(o) {
20426 var i, p;
20427 return i = {}, verb("next"), verb("throw", function(e) {

Callers

nothing calls this directly

Calls 1

verbFunction · 0.85

Tested by

no test coverage detected