|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
886 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
|---|
| 4 | var hasPropertyDescriptors = require('has-property-descriptors')();
|
|---|
| 5 |
|
|---|
| 6 | var $TypeError = require('es-errors/type');
|
|---|
| 7 |
|
|---|
| 8 | var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);
|
|---|
| 9 |
|
|---|
| 10 | var iterProto = require('iterator.prototype');
|
|---|
| 11 | var callBound = require('call-bound');
|
|---|
| 12 |
|
|---|
| 13 | var $isPrototypeOf = callBound('Object.prototype.isPrototypeOf');
|
|---|
| 14 |
|
|---|
| 15 | var $Iterator = typeof Iterator === 'function' ? Iterator : function Iterator() {
|
|---|
| 16 | if (
|
|---|
| 17 | !(this instanceof Iterator)
|
|---|
| 18 | || this.constructor === Iterator
|
|---|
| 19 | || !$isPrototypeOf(Iterator, this.constructor)
|
|---|
| 20 | ) {
|
|---|
| 21 | throw new $TypeError('`Iterator` can not be called or constructed directly');
|
|---|
| 22 | }
|
|---|
| 23 | };
|
|---|
| 24 |
|
|---|
| 25 | if ($Iterator.prototype !== iterProto) {
|
|---|
| 26 | $Iterator.prototype = iterProto;
|
|---|
| 27 | }
|
|---|
| 28 | $defineProperty($Iterator, 'prototype', { writable: false });
|
|---|
| 29 |
|
|---|
| 30 | module.exports = $Iterator;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.