Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
746 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 | var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
|
---|
| 3 | var create = require('../internals/object-create');
|
---|
| 4 | var createPropertyDescriptor = require('../internals/create-property-descriptor');
|
---|
| 5 | var setToStringTag = require('../internals/set-to-string-tag');
|
---|
| 6 | var Iterators = require('../internals/iterators');
|
---|
| 7 |
|
---|
| 8 | var returnThis = function () { return this; };
|
---|
| 9 |
|
---|
| 10 | module.exports = function (IteratorConstructor, NAME, next) {
|
---|
| 11 | var TO_STRING_TAG = NAME + ' Iterator';
|
---|
| 12 | IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
|
---|
| 13 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
|
---|
| 14 | Iterators[TO_STRING_TAG] = returnThis;
|
---|
| 15 | return IteratorConstructor;
|
---|
| 16 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.