Skip to content

Specification defines features in terms of function-literal applications which isn't always a valid rewrite in async contexts. #25858

Closed
@lrhn

Description

@lrhn

Example, o?.m(a1, . . . , an, xn+1 : an+1, . . . , xn+k : an+k) is defined as equivalent to ((x) => x == null?null : x.m(a1, . . . , an, xn+1 : an+1, . . . , xn+k : an+k))(o).

This moves the expressions a1 .. an+k into a new non-async function. If the original expression is in an async function and any of these expressions contain an await, the resulting rewrite is incorrect.

The specification needs another way to introduce new expression-level bindings without resorting to function literals, perhaps let x = e1 in e2 which wouldn't change the scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-specification (deprecated)Deprecated: use area-language and a language- label.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions