Skip to content

yield in an async generator does not await its operand #5317

Open

Description

@trackoor

yield expr inside an async function* resolves the iterator result with expr directly instead of awaiting it first.

JerryScript revision

v3.0.0 and master (b7069350)

Build platform

macOS 26.3 (Darwin 25.3.0 arm64)

Build steps
tools/build.py --clean --debug
Build log

N/A

Test case
async function* ag() {
  yield Promise.resolve(8);
}

ag().next().then(r => {
  print(typeof r.value, r.value, r.done);
});
Execution platform

Same as build platform.

Execution steps
build/bin/jerry testcase.js
Output
object [object Promise] false
Backtrace

N/A

Expected behavior
number 8 false

Credit: https://ucsbplse.github.io/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions