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/2019/IteratorValue.js')
-rw-r--r--node_modules/es-abstract/2019/IteratorValue.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/node_modules/es-abstract/2019/IteratorValue.js b/node_modules/es-abstract/2019/IteratorValue.js
new file mode 100644
index 000000000..5e71a4463
--- /dev/null
+++ b/node_modules/es-abstract/2019/IteratorValue.js
@@ -0,0 +1,18 @@
+'use strict';
+
+var GetIntrinsic = require('../GetIntrinsic');
+
+var $TypeError = GetIntrinsic('%TypeError%');
+
+var Get = require('./Get');
+var Type = require('./Type');
+
+// https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue
+
+module.exports = function IteratorValue(iterResult) {
+ if (Type(iterResult) !== 'Object') {
+ throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
+ }
+ return Get(iterResult, 'value');
+};
+