tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

step-over-regenerator-await.js (1774B)


      1 var rollupBabel7StepOverRegeneratorAwait = (function () {
      2  'use strict';
      3 
      4  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
      5    try {
      6      var info = gen[key](arg);
      7      var value = info.value;
      8    } catch (error) {
      9      reject(error);
     10      return;
     11    }
     12 
     13    if (info.done) {
     14      resolve(value);
     15    } else {
     16      Promise.resolve(value).then(_next, _throw);
     17    }
     18  }
     19 
     20  function _asyncToGenerator(fn) {
     21    return function () {
     22      var self = this,
     23          args = arguments;
     24      return new Promise(function (resolve, reject) {
     25        var gen = fn.apply(self, args);
     26 
     27        function _next(value) {
     28          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
     29        }
     30 
     31        function _throw(err) {
     32          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
     33        }
     34 
     35        _next(undefined);
     36      });
     37    };
     38  }
     39 
     40  var fn =
     41  /*#__PURE__*/
     42  function () {
     43    var _fn = _asyncToGenerator(
     44    /*#__PURE__*/
     45    regeneratorRuntime.mark(function _callee() {
     46      return regeneratorRuntime.wrap(function _callee$(_context) {
     47        while (1) {
     48          switch (_context.prev = _context.next) {
     49            case 0:
     50              console.log("pause here");
     51              _context.next = 3;
     52              return doAsync();
     53 
     54            case 3:
     55              console.log("stopped here");
     56 
     57            case 4:
     58            case "end":
     59              return _context.stop();
     60          }
     61        }
     62      }, _callee, this);
     63    }));
     64 
     65    return function fn() {
     66      return _fn.apply(this, arguments);
     67    };
     68  }();
     69 
     70  function doAsync() {
     71    return Promise.resolve();
     72  }
     73 
     74  function root() {
     75    fn();
     76  }
     77 
     78  return root;
     79 
     80 }());
     81 //# sourceMappingURL=step-over-regenerator-await.js.map