tc39 / proposal-set-methods

Proposal for new Set methods in JS
https://tc39.github.io/proposal-set-methods/
Other
655 stars 15 forks source link

Add a note that IteratorClose is intentionally not called? #81

Closed anba closed 1 year ago

anba commented 1 year ago

Set.prototype.isSupersetOf and Set.prototype.isDisjointFrom don't call IteratorClose, but instead directly return after calling SetDataHas. If this is intentional, it should probably be explicitly noted.

bakkot commented 1 year ago

That was an oversight. In fact it looks like I actually neglected to call it ever, not just those two methods. Is there something special about those two?

Either way I think the right thing will be to call it in every method that calls GetKeysIterator. That's kind of annoying but I think it's the right behavior.

anba commented 1 year ago

The other callers don't have any early returns and also don't have any abrupt completions (except for IteratorStep and IteratorValue, which are ignored for IteratorClose).

bakkot commented 1 year ago

Ah, yes, thanks.