return(value) {
    if (!this.asyncIteratorReader.ownerReadableStream) {
      return Promise.reject(
          new TypeError('There is no more data left in the ReadableStream'));
    }
    if (this.asyncIteratorReader.readRequests.length) {
      return Promise.reject(new TypeError(
          'There are pending read requests in the ReadableStream'));
    }
    if (!this.preventCancel) {
      const result = this.asyncIteratorReader.cancel(value);
      this.asyncIteratorReader.release();
      return result.then(() => ({done: true, value}));
    }
    this.asyncIteratorReader.release();
    return Promise.resolve({done: true, value});
  }
Cancels the underlying stream and resolves with the value.
@param {*} value
@return {!Promise<!IIterableResult<T>>}
@override