code: function invoke(method, arg, resolve, reject) {                                                        // 137
        var record = tryCatch(generator[method], generator, arg);                                            // 138
        if (record.type === "throw") {                                                                       // 139
          reject(record.arg);                                                                                // 140
        } else {                                                                                             // 141
          var result = record.arg;                                                                           // 142
          var value = result.value;                                                                          // 143
          if (value instanceof AwaitArgument) {                                                              // 144
            return Promise.resolve(value.arg).then(function(value) {                                         // 145
              invoke("next", value, resolve, reject);                                                        // 146
            }, function(err) {                                                                               // 147
              invoke("throw", err, resolve, reject);                                                         // 148
            });                                                                                              // 149
          }                                                                                                  // 150
                                                                                                             // 151
          return Promise.resolve(value).then(function(unwrapped) {                                           // 152
            // When a yielded Promise is resolved, its final value becomes                                   // 153
            // the .value of the Promise<{value,done}> result for the                                        // 154
            // current iteration. If the Promise is rejected, however, the                                   // 155
            // result for this iteration will be rejected with the same                                      // 156
            // reason. Note that rejections of yielded Promises are not                                      // 157
            // thrown back into the generator function, as is the case                                       // 158
            // when an awaited Promise is rejected. This difference in                                       // 159
            // behavior between yield and await is important, because it                                     // 160
            // allows the consumer to decide what to do with the yielded                                     // 161
            // rejection (swallow it and continue, manually .throw it back                                   // 162
            // into the generator, abandon iteration, whatever). With                                        // 163
            // await, by contrast, there is no opportunity to examine the                                    // 164
            // rejection reason outside the generator function, so the                                       // 165
            // only option is to throw it from the await expression, and                                     // 166
            // let the generator function handle the exception.                                              // 167
            result.value = unwrapped;                                                                        // 168
            resolve(result);                                                                                 // 169
          }, reject);                                                                                        // 170
        }                                                                                                    // 171
      }
docs: 136