summaryrefslogtreecommitdiff
path: root/src/node_modules/es-abstract/2016/IteratorValue.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_modules/es-abstract/2016/IteratorValue.js')
-rw-r--r--src/node_modules/es-abstract/2016/IteratorValue.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/node_modules/es-abstract/2016/IteratorValue.js b/src/node_modules/es-abstract/2016/IteratorValue.js
new file mode 100644
index 0000000..5e71a44
--- /dev/null
+++ b/src/node_modules/es-abstract/2016/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');
+};
+