regenerator-runtime
Advanced tools
Comparing version 0.13.10 to 0.13.11
@@ -5,3 +5,3 @@ { | ||
"description": "Runtime for Regenerator-compiled generator and async functions.", | ||
"version": "0.13.10", | ||
"version": "0.13.11", | ||
"main": "runtime.js", | ||
@@ -17,5 +17,5 @@ "keywords": [ | ||
"type": "git", | ||
"url": "https://github.com/facebook/regenerator/tree/master/packages/runtime" | ||
"url": "https://github.com/facebook/regenerator/tree/main/packages/runtime" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -332,27 +332,28 @@ /** | ||
function maybeInvokeDelegate(delegate, context) { | ||
var method = delegate.iterator[context.method]; | ||
var methodName = context.method; | ||
var method = delegate.iterator[methodName]; | ||
if (method === undefined) { | ||
// A .throw or .return when the delegate iterator has no .throw | ||
// method always terminates the yield* loop. | ||
// method, or a missing .next mehtod, always terminate the | ||
// yield* loop. | ||
context.delegate = null; | ||
if (context.method === "throw") { | ||
// Note: ["return"] must be used for ES3 parsing compatibility. | ||
if (delegate.iterator["return"]) { | ||
// If the delegate iterator has a return method, give it a | ||
// chance to clean up. | ||
context.method = "return"; | ||
context.arg = undefined; | ||
maybeInvokeDelegate(delegate, context); | ||
// Note: ["return"] must be used for ES3 parsing compatibility. | ||
if (methodName === "throw" && delegate.iterator["return"]) { | ||
// If the delegate iterator has a return method, give it a | ||
// chance to clean up. | ||
context.method = "return"; | ||
context.arg = undefined; | ||
maybeInvokeDelegate(delegate, context); | ||
if (context.method === "throw") { | ||
// If maybeInvokeDelegate(context) changed context.method from | ||
// "return" to "throw", let that override the TypeError below. | ||
return ContinueSentinel; | ||
} | ||
if (context.method === "throw") { | ||
// If maybeInvokeDelegate(context) changed context.method from | ||
// "return" to "throw", let that override the TypeError below. | ||
return ContinueSentinel; | ||
} | ||
} | ||
if (methodName !== "return") { | ||
context.method = "throw"; | ||
context.arg = new TypeError( | ||
"The iterator does not provide a 'throw' method"); | ||
"The iterator does not provide a '" + methodName + "' method"); | ||
} | ||
@@ -359,0 +360,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
27759
659