summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/shell.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-24 12:27:00 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-24 12:27:00 +0100
commit1ea1ed151571a523d1c8016dcd314e12238cd785 (patch)
tree86681b1375081559afa9117eb5800f1403c62e90 /js/src/tests/ecma_6/shell.js
parent2bb0252ab48a97a72c33cef9cbe54e86563f15c9 (diff)
downloadUXP-1ea1ed151571a523d1c8016dcd314e12238cd785.tar
UXP-1ea1ed151571a523d1c8016dcd314e12238cd785.tar.gz
UXP-1ea1ed151571a523d1c8016dcd314e12238cd785.tar.lz
UXP-1ea1ed151571a523d1c8016dcd314e12238cd785.tar.xz
UXP-1ea1ed151571a523d1c8016dcd314e12238cd785.zip
Bug 1147371: Implement calling IteratorClose and "return" on iterators in yield*
Issue #74
Diffstat (limited to 'js/src/tests/ecma_6/shell.js')
-rw-r--r--js/src/tests/ecma_6/shell.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/js/src/tests/ecma_6/shell.js b/js/src/tests/ecma_6/shell.js
index 1d067a282..4da9221d6 100644
--- a/js/src/tests/ecma_6/shell.js
+++ b/js/src/tests/ecma_6/shell.js
@@ -22,14 +22,17 @@
/** Make an iterator with a return method. */
global.makeIterator = function makeIterator(overrides) {
var iterator = {
- next: function() {
+ throw: function(e) {
+ throw e;
+ },
+ next: function(x) {
if (overrides && overrides.next)
- return overrides.next();
+ return overrides.next(x);
return { done: false };
},
- return: function() {
+ return: function(x) {
if (overrides && overrides.ret)
- return overrides.ret();
+ return overrides.ret(x);
return { done: true };
}
};