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

Function next

tslib.es6.mjs:339–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337 }
338 var r, s = 0;
339 function next() {
340 while (r = env.stack.pop()) {
341 try {
342 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
343 if (r.dispose) {
344 var result = r.dispose.call(r.value);
345 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
346 }
347 else s |= 1;
348 }
349 catch (e) {
350 fail(e);
351 }
352 }
353 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
354 if (env.hasError) throw env.error;
355 }
356 return next();
357}
358

Callers 1

__disposeResourcesFunction · 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…