step-over-regenerator-await.js (1387B)
1 var rollupBabel6StepOverRegeneratorAwait = (function () { 2 'use strict'; 3 4 function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } 5 6 var fn = function () { 7 var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { 8 return regeneratorRuntime.wrap(function _callee$(_context) { 9 while (1) { 10 switch (_context.prev = _context.next) { 11 case 0: 12 console.log("pause here"); 13 14 _context.next = 3; 15 return doAsync(); 16 17 case 3: 18 19 console.log("stopped here"); 20 21 case 4: 22 case "end": 23 return _context.stop(); 24 } 25 } 26 }, _callee, this); 27 })); 28 29 function fn() { 30 return _ref.apply(this, arguments); 31 } 32 33 return fn; 34 }(); 35 36 function doAsync() { 37 return Promise.resolve(); 38 } 39 40 function root() { 41 fn(); 42 } 43 44 return root; 45 46 }()); 47 //# sourceMappingURL=step-over-regenerator-await.js.map