toIterable<T> method

Iterable<T> toIterable<T>()

Implementation

Iterable<T> toIterable<T>() sync* {
  final generator = js_util.getProperty(this, _iterator);
  final iterator = js_util.callMethod(generator, 'call', []);

  while (true) {
    final result = _next<T>(iterator);

    if (result.done) {
      break;
    }
    yield result.value;
  }
}