MCPcopy Create free account
hub / github.com/microsoft/tslib / next

Function next

tslib.js:388–404  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

386 }
387 var r, s = 0;
388 function next() {
389 while (r = env.stack.pop()) {
390 try {
391 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
392 if (r.dispose) {
393 var result = r.dispose.call(r.value);
394 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
395 }
396 else s |= 1;
397 }
398 catch (e) {
399 fail(e);
400 }
401 }
402 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
403 if (env.hasError) throw env.error;
404 }
405 return next();
406 };
407

Callers 1

tslib.jsFile · 0.70

Calls 1

failFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…