main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
495 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var Get = require('es-abstract/2024/Get');
|
---|
6 | var Type = require('es-abstract/2024/Type');
|
---|
7 |
|
---|
8 | module.exports = function GetIteratorDirect(obj) {
|
---|
9 | if (Type(obj) !== 'Object') {
|
---|
10 | throw new $TypeError('Assertion failed: `obj` must be an Object');
|
---|
11 | }
|
---|
12 |
|
---|
13 | var nextMethod = Get(obj, 'next'); // step 2
|
---|
14 |
|
---|
15 | var iteratorRecord = { '[[Iterator]]': obj, '[[NextMethod]]': nextMethod, '[[Done]]': false }; // step 3
|
---|
16 |
|
---|
17 | return iteratorRecord; // step 4
|
---|
18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.