Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/es-abstract/2017/IteratorNext.js')
-rw-r--r--node_modules/es-abstract/2017/IteratorNext.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/node_modules/es-abstract/2017/IteratorNext.js b/node_modules/es-abstract/2017/IteratorNext.js
new file mode 100644
index 000000000..7e5991561
--- /dev/null
+++ b/node_modules/es-abstract/2017/IteratorNext.js
@@ -0,0 +1,18 @@
+'use strict';
+
+var GetIntrinsic = require('../GetIntrinsic');
+
+var $TypeError = GetIntrinsic('%TypeError%');
+
+var Invoke = require('./Invoke');
+var Type = require('./Type');
+
+// https://ecma-international.org/ecma-262/6.0/#sec-iteratornext
+
+module.exports = function IteratorNext(iterator, value) {
+ var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]);
+ if (Type(result) !== 'Object') {
+ throw new $TypeError('iterator next must return an object');
+ }
+ return result;
+};