- Build: Fix build input for xdomain; update external files per latest
- Docs: Update dev. license badge per latest - Linting (LGTM): Fix paths - Linting (ESLint): Fix ignore path - npm: Fix copy file paths
This commit is contained in:
35
src/external/regenerator-runtime/runtime.js
vendored
35
src/external/regenerator-runtime/runtime.js
vendored
@@ -16,6 +16,24 @@ var runtime = (function (exports) {
|
||||
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
||||
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
||||
|
||||
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) {
|
||||
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
||||
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
||||
@@ -86,16 +104,19 @@ var runtime = (function (exports) {
|
||||
Generator.prototype = Object.create(IteratorPrototype);
|
||||
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
||||
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
||||
GeneratorFunctionPrototype[toStringTagSymbol] =
|
||||
GeneratorFunction.displayName = "GeneratorFunction";
|
||||
GeneratorFunction.displayName = define(
|
||||
GeneratorFunctionPrototype,
|
||||
toStringTagSymbol,
|
||||
"GeneratorFunction"
|
||||
);
|
||||
|
||||
// Helper for defining the .next, .throw, and .return methods of the
|
||||
// Iterator interface in terms of a single ._invoke method.
|
||||
function defineIteratorMethods(prototype) {
|
||||
["next", "throw", "return"].forEach(function(method) {
|
||||
prototype[method] = function(arg) {
|
||||
define(prototype, method, function(arg) {
|
||||
return this._invoke(method, arg);
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -114,9 +135,7 @@ var runtime = (function (exports) {
|
||||
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
||||
} else {
|
||||
genFun.__proto__ = GeneratorFunctionPrototype;
|
||||
if (!(toStringTagSymbol in genFun)) {
|
||||
genFun[toStringTagSymbol] = "GeneratorFunction";
|
||||
}
|
||||
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
||||
}
|
||||
genFun.prototype = Object.create(Gp);
|
||||
return genFun;
|
||||
@@ -386,7 +405,7 @@ var runtime = (function (exports) {
|
||||
// unified ._invoke helper method.
|
||||
defineIteratorMethods(Gp);
|
||||
|
||||
Gp[toStringTagSymbol] = "Generator";
|
||||
define(Gp, toStringTagSymbol, "Generator");
|
||||
|
||||
// A Generator should always return itself as the iterator object when the
|
||||
// @@iterator function is called on it. Some browsers' implementations of the
|
||||
|
||||
Reference in New Issue
Block a user