text: function AsyncGenerator(gen) {
      var front, back;
      function resume(key, arg) {
          try {
              var result = gen[key](arg), value = result.value, wrappedAwait = value instanceof _AwaitValue;
              Promise.resolve(wrappedAwait ? value.wrapped : value).then(function(arg) {
                  if (wrappedAwait) {
                      resume("next", arg);
                      return;
                  }
                  settle(result.done ? "return" : "normal", arg);
              }, function(err) {
                  resume("throw", err);
              });
          } catch (err) {
              settle("throw", err);
          }
      }
      function settle(type, value) {
          switch(type){
              case "return":
                  front.resolve({
                      value: value,
                      done: !0
                  });
                  break;
              case "throw":
                  front.reject(value);
                  break;
              default:
                  front.resolve({
                      value: value,
                      done: !1
                  });
                  break;
          }
          (front = front.next) ? resume(front.key, front.arg) : back = null;
      }
      this._invoke = function(key, arg) {
          return new Promise(function(resolve, reject) {
              var request = {
                  key: key,
                  arg: arg,
                  resolve: resolve,
                  reject: reject,
                  next: null
              };
              back ? back = back.next = request : (front = back = request, resume(key, arg));
          });
      }, "function" != typeof gen.return && (this.return = void 0);
  }
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
      try {
          var info = gen[key](arg), value = info.value;
      } catch (error) {
          reject(error);
          return;
      }
      info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
  }
  function _asyncToGenerator(fn) {
      return function() {
          var self = this, args = arguments;
          return new Promise(function(resolve, reject) {
              var gen = fn.apply(self, args);
              function _next(value) {
                  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
              }
              function _throw(err) {
                  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
              }
              _next(void 0);
          });
      };
  }
  function _awaitAsyncGenerator(value) {
      return new _AwaitValue(value);
  }
  function _AwaitValue(value) {
      this.wrapped = value;
  }
  function _classPrivateMethodGet(receiver, privateSet, fn) {
      if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
      return fn;
  }
  function _defineProperties(target, props) {
      for(var i = 0; i < props.length; i++){
          var descriptor = props[i];
          descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
      }
  }
  "function" == typeof Symbol && Symbol.asyncIterator && (AsyncGenerator.prototype[Symbol.asyncIterator] = function() {
      return this;
  }), AsyncGenerator.prototype.next = function(arg) {
      return this._invoke("next", arg);
  }, AsyncGenerator.prototype.throw = function(arg) {
      return this._invoke("throw", arg);
  }, AsyncGenerator.prototype.return = function(arg) {
      return this._invoke("return", arg);
  };
  import regeneratorRuntime from "regenerator-runtime";
  new (function() {
      var baz = regeneratorRuntime.mark(function() {
          return regeneratorRuntime.wrap(function(_ctx) {
              for(;;)switch(_ctx.prev = _ctx.next){
                  case 0:
                      return _ctx.next = 2, 42;
                  case 2:
                  case "end":
                      return _ctx.stop();
              }
          }, baz);
      }), _bar = new WeakSet(), _baz = new WeakSet(), _qux = new WeakSet(), _class = function() {
          "use strict";
          var Constructor, protoProps, staticProps;
          function _class() {
              !function(instance, Constructor) {
                  if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
              }(this, _class), _bar.add(this), _baz.add(this), _qux.add(this);
          }
          return Constructor = _class, protoProps = [
              {
                  key: "foo",
                  value: function() {
                      var _this = this;
                      return _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
                          var b;
                          return regeneratorRuntime.wrap(function(_ctx) {
                              for(;;)switch(_ctx.prev = _ctx.next){
                                  case 0:
                                      return _ctx.next = 2, _classPrivateMethodGet(_this, _bar, bar).call(_this);
                                  case 2:
                                      return b = _ctx.sent, _ctx.t0 = b + (_classPrivateMethodGet(_this, _baz, baz).call(_this).next().value || 0), _ctx.next = 6, _classPrivateMethodGet(_this, _qux, qux).call(_this).next();
                                  case 6:
                                      if (_ctx.t1 = _ctx.sent.value, _ctx.t1) {
                                          _ctx.next = 9;
                                          break;
                                      }
                                      _ctx.t1 = 0;
                                  case 9:
                                      return _ctx.t2 = _ctx.t1, _ctx.abrupt("return", _ctx.t0 + _ctx.t2);
                                  case 11:
                                  case "end":
                                      return _ctx.stop();
                              }
                          }, _callee);
                      }))();
                  }
              }
          ], _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), _class;
      }();
      function bar() {
          return _bar1.apply(this, arguments);
      }
      function _bar1() {
          return (_bar1 = _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
              return regeneratorRuntime.wrap(function(_ctx) {
                  for(;;)switch(_ctx.prev = _ctx.next){
                      case 0:
                          return _ctx.next = 2, Promise.resolve(42);
                      case 2:
                          return _ctx.abrupt("return", _ctx.sent);
                      case 3:
                      case "end":
                          return _ctx.stop();
                  }
              }, _callee);
          }))).apply(this, arguments);
      }
      function qux() {
          return _qux1.apply(this, arguments);
      }
      function _qux1() {
          var fn;
          return (_qux1 = (fn = regeneratorRuntime.mark(function _callee() {
              return regeneratorRuntime.wrap(function(_ctx) {
                  for(;;)switch(_ctx.prev = _ctx.next){
                      case 0:
                          return _ctx.next = 2, _awaitAsyncGenerator(Promise.resolve(42));
                      case 2:
                          return _ctx.next = 4, _ctx.sent;
                      case 4:
                      case "end":
                          return _ctx.stop();
                  }
              }, _callee);
          }), function() {
              return new AsyncGenerator(fn.apply(this, arguments));
          })).apply(this, arguments);
      }
      return _class;
  }())().foo().then(console.log);
  