Skip to content

Transpiled async generators return a promise value #23731

@falsandtru

Description

@falsandtru

At least Chrome unwraps promise values. This makes a different runtime behavior.

TypeScript Version: 2.7.0-dev.201xxxxx

Search Terms:

Code

(async function* () {yield Promise.resolve(0)})().next().then(console.log)

Expected behavior:

Outputs {value: 0, done: false}.

Actual behavior:

Outputs {value: Promise, done: false}.

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions