main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
892 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 | var IS_PURE = require('../internals/is-pure');
|
---|
9 |
|
---|
10 | // `AsyncIterator.from` method
|
---|
11 | // https://github.com/tc39/proposal-async-iterator-helpers
|
---|
12 | $({ target: 'AsyncIterator', stat: true, forced: IS_PURE }, {
|
---|
13 | from: function from(O) {
|
---|
14 | var iteratorRecord = getAsyncIteratorFlattenable(typeof O == 'string' ? toObject(O) : O);
|
---|
15 | return isPrototypeOf(AsyncIteratorPrototype, iteratorRecord.iterator)
|
---|
16 | ? iteratorRecord.iterator
|
---|
17 | : new WrapAsyncIterator(iteratorRecord);
|
---|
18 | }
|
---|
19 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.