summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/Utilities.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/builtin/Utilities.js')
-rw-r--r--js/src/builtin/Utilities.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/builtin/Utilities.js b/js/src/builtin/Utilities.js
index bfb1fe7f4..2dece3801 100644
--- a/js/src/builtin/Utilities.js
+++ b/js/src/builtin/Utilities.js
@@ -154,6 +154,29 @@ function GetIterator(obj, method) {
return iterator;
}
+// ES2017 draft rev 7.4.6.
+// When completion.[[Type]] is throw.
+function IteratorCloseThrow(iter) {
+ // Steps 1-2 (implicit)
+
+ // Step 3.
+ var returnMethod = GetMethod(iter, "return");
+
+ // Step 4 (done in caller).
+ if (returnMethod === undefined)
+ return;
+
+ try {
+ // Step 5.
+ callContentFunction(returnMethod, iter);
+ } catch (e) {
+ }
+
+ // Step 6 (done in caller).
+
+ // Steps 7-9 (skipped).
+}
+
var _builtinCtorsCache = {__proto__: null};
function GetBuiltinConstructor(builtinName) {