Skip to content

Update ongoing promise in async iterator return() method #51725

@MattiasBuelens

Description

@MattiasBuelens

There's an edge case with the current Web IDL bindings for async iterators where manually calling return(); next() could result in the next() promise resolving before the return() promise. The latest version of the Web IDL specification fixes this by updating the "ongoing promise" in the async iterator return() method.

For Node.js, this affects ReadableStream.prototype[Symbol.asyncIterator]. More specifically, this part needs to be changed:

return(error) {
return state.current ?
PromisePrototypeThen(
state.current,
() => returnSteps(error),
() => returnSteps(error)) :
returnSteps(error);
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions