- Build: Update

- npm: Add `prepare` script to update license-badges, copy, and prep (leaving prepublishOnly to handle build-docs)
- npm: Make license badge prep. in series as getting too many files open error running in parallel
- npm: Update devDeps
This commit is contained in:
Brett Zamir
2020-04-01 15:32:51 +08:00
parent ea58adbab1
commit e4f36a3c5b
17 changed files with 323 additions and 295 deletions

View File

@@ -130,7 +130,7 @@ var runtime = (function (exports) {
return { __await: arg };
};
function AsyncIterator(generator) {
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
@@ -141,14 +141,14 @@ var runtime = (function (exports) {
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function(value) {
return PromiseImpl.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function(unwrapped) {
return PromiseImpl.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
@@ -166,7 +166,7 @@ var runtime = (function (exports) {
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function(resolve, reject) {
return new PromiseImpl(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
@@ -206,9 +206,12 @@ var runtime = (function (exports) {
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function(innerFn, outerFn, self, tryLocsList) {
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0) PromiseImpl = Promise;
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList)
wrap(innerFn, outerFn, self, tryLocsList),
PromiseImpl
);
return exports.isGeneratorFunction(outerFn)