regenerator-runtime
Advanced tools
Comparing version 0.13.6 to 0.13.7
@@ -5,3 +5,3 @@ { | ||
"description": "Runtime for Regenerator-compiled generator and async functions.", | ||
"version": "0.13.6", | ||
"version": "0.13.7", | ||
"main": "runtime.js", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
@@ -19,2 +19,20 @@ /** | ||
function define(obj, key, value) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
return obj[key]; | ||
} | ||
try { | ||
// IE 8 has a broken Object.defineProperty that only works on DOM objects. | ||
define({}, ""); | ||
} catch (err) { | ||
define = function(obj, key, value) { | ||
return obj[key] = value; | ||
}; | ||
} | ||
function wrap(innerFn, outerFn, self, tryLocsList) { | ||
@@ -86,9 +104,2 @@ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. | ||
function ensureDefaultToStringTag(object, defaultValue) { | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1644581#c6 | ||
return toStringTagSymbol in object | ||
? object[toStringTagSymbol] | ||
: object[toStringTagSymbol] = defaultValue; | ||
} | ||
var Gp = GeneratorFunctionPrototype.prototype = | ||
@@ -98,4 +109,5 @@ Generator.prototype = Object.create(IteratorPrototype); | ||
GeneratorFunctionPrototype.constructor = GeneratorFunction; | ||
GeneratorFunction.displayName = ensureDefaultToStringTag( | ||
GeneratorFunction.displayName = define( | ||
GeneratorFunctionPrototype, | ||
toStringTagSymbol, | ||
"GeneratorFunction" | ||
@@ -108,5 +120,5 @@ ); | ||
["next", "throw", "return"].forEach(function(method) { | ||
prototype[method] = function(arg) { | ||
define(prototype, method, function(arg) { | ||
return this._invoke(method, arg); | ||
}; | ||
}); | ||
}); | ||
@@ -130,3 +142,3 @@ } | ||
genFun.__proto__ = GeneratorFunctionPrototype; | ||
ensureDefaultToStringTag(genFun, "GeneratorFunction"); | ||
define(genFun, toStringTagSymbol, "GeneratorFunction"); | ||
} | ||
@@ -401,3 +413,3 @@ genFun.prototype = Object.create(Gp); | ||
ensureDefaultToStringTag(Gp, "Generator"); | ||
define(Gp, toStringTagSymbol, "Generator"); | ||
@@ -404,0 +416,0 @@ // A Generator should always return itself as the iterator object when the |
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
27153
645