[heycam/webidl] Make async iterator return() function after failed next (#891)

Previously, we would only set the async iterator's "ongoing promise" to null when the async iterator next steps succeeded. This meant that calling return() after a failed next() would not call the async iterator return steps, thus potentially preventing the cleanup of any associated resources. This changes the spec to reset the ongoing promise after the async iterator next steps complete, regardless of whether they succeed or fail.

Credit to @TimothyGu for finding this in https://github.com/jsdom/webidl2js/pull/224#discussion_r433333677. (Timothy, please review!)

Tests for this are added in https://github.com/web-platform-tests/wpt/pull/22982, in particular https://github.com/web-platform-tests/wpt/pull/22982/commits/a40dd07cb02873bb90cc12fa4e49b614943fc095#diff-06301d621524766e84e076125ea8c93bR341-R367
You can view, comment on, or merge this pull request online at:

  https://github.com/heycam/webidl/pull/891

-- Commit Summary --

  * Make async iterator return() function after failed next

-- File Changes --

    M index.bs (9)

-- Patch Links --

https://github.com/heycam/webidl/pull/891.patch
https://github.com/heycam/webidl/pull/891.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/891

Received on Tuesday, 2 June 2020 21:28:40 UTC