wp/wp-includes/js/dist/vendor/regenerator-runtime.js
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
     8 var runtime = (function (exports) {
     8 var runtime = (function (exports) {
     9   "use strict";
     9   "use strict";
    10 
    10 
    11   var Op = Object.prototype;
    11   var Op = Object.prototype;
    12   var hasOwn = Op.hasOwnProperty;
    12   var hasOwn = Op.hasOwnProperty;
       
    13   var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };
    13   var undefined; // More compressible than void 0.
    14   var undefined; // More compressible than void 0.
    14   var $Symbol = typeof Symbol === "function" ? Symbol : {};
    15   var $Symbol = typeof Symbol === "function" ? Symbol : {};
    15   var iteratorSymbol = $Symbol.iterator || "@@iterator";
    16   var iteratorSymbol = $Symbol.iterator || "@@iterator";
    16   var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
    17   var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
    17   var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    18   var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    40     var generator = Object.create(protoGenerator.prototype);
    41     var generator = Object.create(protoGenerator.prototype);
    41     var context = new Context(tryLocsList || []);
    42     var context = new Context(tryLocsList || []);
    42 
    43 
    43     // The ._invoke method unifies the implementations of the .next,
    44     // The ._invoke method unifies the implementations of the .next,
    44     // .throw, and .return methods.
    45     // .throw, and .return methods.
    45     generator._invoke = makeInvokeMethod(innerFn, self, context);
    46     defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) });
    46 
    47 
    47     return generator;
    48     return generator;
    48   }
    49   }
    49   exports.wrap = wrap;
    50   exports.wrap = wrap;
    50 
    51 
   101   }
   102   }
   102 
   103 
   103   var Gp = GeneratorFunctionPrototype.prototype =
   104   var Gp = GeneratorFunctionPrototype.prototype =
   104     Generator.prototype = Object.create(IteratorPrototype);
   105     Generator.prototype = Object.create(IteratorPrototype);
   105   GeneratorFunction.prototype = GeneratorFunctionPrototype;
   106   GeneratorFunction.prototype = GeneratorFunctionPrototype;
   106   define(Gp, "constructor", GeneratorFunctionPrototype);
   107   defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true });
   107   define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
   108   defineProperty(
       
   109     GeneratorFunctionPrototype,
       
   110     "constructor",
       
   111     { value: GeneratorFunction, configurable: true }
       
   112   );
   108   GeneratorFunction.displayName = define(
   113   GeneratorFunction.displayName = define(
   109     GeneratorFunctionPrototype,
   114     GeneratorFunctionPrototype,
   110     toStringTagSymbol,
   115     toStringTagSymbol,
   111     "GeneratorFunction"
   116     "GeneratorFunction"
   112   );
   117   );
   212         ) : callInvokeWithMethodAndArg();
   217         ) : callInvokeWithMethodAndArg();
   213     }
   218     }
   214 
   219 
   215     // Define the unified helper method that is used to implement .next,
   220     // Define the unified helper method that is used to implement .next,
   216     // .throw, and .return (see defineIteratorMethods).
   221     // .throw, and .return (see defineIteratorMethods).
   217     this._invoke = enqueue;
   222     defineProperty(this, "_invoke", { value: enqueue });
   218   }
   223   }
   219 
   224 
   220   defineIteratorMethods(AsyncIterator.prototype);
   225   defineIteratorMethods(AsyncIterator.prototype);
   221   define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
   226   define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
   222     return this;
   227     return this;
   322   // Call delegate.iterator[context.method](context.arg) and handle the
   327   // Call delegate.iterator[context.method](context.arg) and handle the
   323   // result, either by returning a { value, done } result from the
   328   // result, either by returning a { value, done } result from the
   324   // delegate iterator, or by modifying context.method and context.arg,
   329   // delegate iterator, or by modifying context.method and context.arg,
   325   // setting context.delegate to null, and returning the ContinueSentinel.
   330   // setting context.delegate to null, and returning the ContinueSentinel.
   326   function maybeInvokeDelegate(delegate, context) {
   331   function maybeInvokeDelegate(delegate, context) {
   327     var method = delegate.iterator[context.method];
   332     var methodName = context.method;
       
   333     var method = delegate.iterator[methodName];
   328     if (method === undefined) {
   334     if (method === undefined) {
   329       // A .throw or .return when the delegate iterator has no .throw
   335       // A .throw or .return when the delegate iterator has no .throw
   330       // method always terminates the yield* loop.
   336       // method, or a missing .next mehtod, always terminate the
       
   337       // yield* loop.
   331       context.delegate = null;
   338       context.delegate = null;
   332 
   339 
   333       if (context.method === "throw") {
   340       // Note: ["return"] must be used for ES3 parsing compatibility.
   334         // Note: ["return"] must be used for ES3 parsing compatibility.
   341       if (methodName === "throw" && delegate.iterator["return"]) {
   335         if (delegate.iterator["return"]) {
   342         // If the delegate iterator has a return method, give it a
   336           // If the delegate iterator has a return method, give it a
   343         // chance to clean up.
   337           // chance to clean up.
   344         context.method = "return";
   338           context.method = "return";
   345         context.arg = undefined;
   339           context.arg = undefined;
   346         maybeInvokeDelegate(delegate, context);
   340           maybeInvokeDelegate(delegate, context);
   347 
   341 
   348         if (context.method === "throw") {
   342           if (context.method === "throw") {
   349           // If maybeInvokeDelegate(context) changed context.method from
   343             // If maybeInvokeDelegate(context) changed context.method from
   350           // "return" to "throw", let that override the TypeError below.
   344             // "return" to "throw", let that override the TypeError below.
   351           return ContinueSentinel;
   345             return ContinueSentinel;
   352         }
   346           }
   353       }
   347         }
   354       if (methodName !== "return") {
   348 
       
   349         context.method = "throw";
   355         context.method = "throw";
   350         context.arg = new TypeError(
   356         context.arg = new TypeError(
   351           "The iterator does not provide a 'throw' method");
   357           "The iterator does not provide a '" + methodName + "' method");
   352       }
   358       }
   353 
   359 
   354       return ContinueSentinel;
   360       return ContinueSentinel;
   355     }
   361     }
   356 
   362 
   450     this.tryEntries = [{ tryLoc: "root" }];
   456     this.tryEntries = [{ tryLoc: "root" }];
   451     tryLocsList.forEach(pushTryEntry, this);
   457     tryLocsList.forEach(pushTryEntry, this);
   452     this.reset(true);
   458     this.reset(true);
   453   }
   459   }
   454 
   460 
   455   exports.keys = function(object) {
   461   exports.keys = function(val) {
       
   462     var object = Object(val);
   456     var keys = [];
   463     var keys = [];
   457     for (var key in object) {
   464     for (var key in object) {
   458       keys.push(key);
   465       keys.push(key);
   459     }
   466     }
   460     keys.reverse();
   467     keys.reverse();
   478       return next;
   485       return next;
   479     };
   486     };
   480   };
   487   };
   481 
   488 
   482   function values(iterable) {
   489   function values(iterable) {
   483     if (iterable) {
   490     if (iterable || iterable === "") {
   484       var iteratorMethod = iterable[iteratorSymbol];
   491       var iteratorMethod = iterable[iteratorSymbol];
   485       if (iteratorMethod) {
   492       if (iteratorMethod) {
   486         return iteratorMethod.call(iterable);
   493         return iteratorMethod.call(iterable);
   487       }
   494       }
   488 
   495 
   508 
   515 
   509         return next.next = next;
   516         return next.next = next;
   510       }
   517       }
   511     }
   518     }
   512 
   519 
   513     // Return an iterator with no values.
   520     throw new TypeError(typeof iterable + " is not iterable");
   514     return { next: doneResult };
       
   515   }
   521   }
   516   exports.values = values;
   522   exports.values = values;
   517 
   523 
   518   function doneResult() {
   524   function doneResult() {
   519     return { value: undefined, done: true };
   525     return { value: undefined, done: true };