regenerator-runtime
Advanced tools
Comparing version 0.13.3 to 0.13.4
@@ -5,3 +5,3 @@ { | ||
"description": "Runtime for Regenerator-compiled generator and async functions.", | ||
"version": "0.13.3", | ||
"version": "0.13.4", | ||
"main": "runtime.js", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
@@ -133,3 +133,3 @@ /** | ||
function AsyncIterator(generator) { | ||
function AsyncIterator(generator, PromiseImpl) { | ||
function invoke(method, arg, resolve, reject) { | ||
@@ -145,3 +145,3 @@ var record = tryCatch(generator[method], generator, arg); | ||
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); | ||
@@ -153,3 +153,3 @@ }, function(err) { | ||
return Promise.resolve(value).then(function(unwrapped) { | ||
return PromiseImpl.resolve(value).then(function(unwrapped) { | ||
// When a yielded Promise is resolved, its final value becomes | ||
@@ -172,3 +172,3 @@ // the .value of the Promise<{value,done}> result for the | ||
function callInvokeWithMethodAndArg() { | ||
return new Promise(function(resolve, reject) { | ||
return new PromiseImpl(function(resolve, reject) { | ||
invoke(method, arg, resolve, reject); | ||
@@ -213,5 +213,8 @@ }); | ||
// 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 | ||
); | ||
@@ -218,0 +221,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26756
627