Skip to content

Commit

Permalink
https://github.com/tc39/proposal-iterator-helpers/pull/274
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed May 31, 2023
1 parent e0ffa73 commit 412bcf6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ info: |
features: [iterator-helpers]
flags: []
---*/
let iter = Iterator.prototype.drop.call({ next: 0 }, 1);

assert.throws(TypeError, function() {
Iterator.prototype.drop.call({ next: 0 }, 1);
iter.next();
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ info: |
features: [iterator-helpers]
flags: []
---*/
let iter = Iterator.prototype.filter.call({ next: 0 }, () => true);

assert.throws(TypeError, function() {
Iterator.prototype.filter.call({ next: 0 }, () => true);
iter.next();
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ info: |
features: [iterator-helpers]
flags: []
---*/
let iter = Iterator.prototype.flatMap.call({ next: 0 }, () => []);

assert.throws(TypeError, function() {
Iterator.prototype.flatMap.call({ next: 0 }, () => []);
iter.next();
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ info: |
features: [iterator-helpers]
flags: []
---*/
let iter = Iterator.prototype.map.call({ next: 0 }, () => 0);

assert.throws(TypeError, function() {
Iterator.prototype.map.call({ next: 0 }, () => 0);
iter.next();
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ info: |
features: [iterator-helpers]
flags: []
---*/
let iter = Iterator.prototype.take.call({ next: 0 }, 1);

assert.throws(TypeError, function() {
Iterator.prototype.take.call({ next: 0 }, 1);
iter.next();
});

0 comments on commit 412bcf6

Please sign in to comment.