Skip to content

Call return() method of Set-like iterators#1167

Merged
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
bnoordhuis:setlike-iter-return
Sep 27, 2025
Merged

Call return() method of Set-like iterators#1167
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
bnoordhuis:setlike-iter-return

Conversation

@bnoordhuis
Copy link
Copy Markdown
Contributor

Change the behavior of the following methods:

  • Set.prototype.isDisjointFrom
  • Set.prototype.isSupersetOf

Specifically, for iterators coming from set-like objects:

  • DO NOT invoke return() when the iterator is exhausted
  • DO invoke return() when the iterator is NOT exhausted

test262 doesn't test it but the spec seems to mandate it and V8 and SM both implement it.

Change the behavior of the following methods:

- Set.prototype.isDisjointFrom
- Set.prototype.isSupersetOf

Specifically, for iterators coming from set-like objects:

- DO NOT invoke return() when the iterator is exhausted
- DO invoke return() when the iterator is NOT exhausted

test262 doesn't test it but the spec seems to mandate it and V8 and SM
both implement it.
@bnoordhuis bnoordhuis merged commit 6167dcb into quickjs-ng:master Sep 27, 2025
127 checks passed
@bnoordhuis bnoordhuis deleted the setlike-iter-return branch September 27, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants