|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
842 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | var $ = require('../internals/export');
|
|---|
| 3 | var toObject = require('../internals/to-object');
|
|---|
| 4 | var isPrototypeOf = require('../internals/object-is-prototype-of');
|
|---|
| 5 | var getAsyncIteratorFlattenable = require('../internals/get-async-iterator-flattenable');
|
|---|
| 6 | var AsyncIteratorPrototype = require('../internals/async-iterator-prototype');
|
|---|
| 7 | var WrapAsyncIterator = require('../internals/async-iterator-wrap');
|
|---|
| 8 |
|
|---|
| 9 | // `AsyncIterator.from` method
|
|---|
| 10 | // https://github.com/tc39/proposal-async-iterator-helpers
|
|---|
| 11 | $({ target: 'AsyncIterator', stat: true, forced: true }, {
|
|---|
| 12 | from: function from(O) {
|
|---|
| 13 | var iteratorRecord = getAsyncIteratorFlattenable(typeof O == 'string' ? toObject(O) : O);
|
|---|
| 14 | return isPrototypeOf(AsyncIteratorPrototype, iteratorRecord.iterator)
|
|---|
| 15 | ? iteratorRecord.iterator
|
|---|
| 16 | : new WrapAsyncIterator(iteratorRecord);
|
|---|
| 17 | }
|
|---|
| 18 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.