Skip to content

Most implementations seem to have missed that await x ** 2 is not legal #2197

@bakkot

Description

@bakkot

Moving discussion from microsoft/TypeScript#40916.

Quoting @DanielRosenwasser:

I can't seem to find a derivation for ExponentiationExpression to await 1 ** 1.
ExponentiationExpression seems to need an UpdateExpression on the left, which does not include an AwaitExpression. On the other hand, UnaryExpression does, but that's kind of the point of the syntax split.

My reading (now that I look) matches his. But V8, SpiderMonkey, JavaScriptCore, engine262, babel, shift, flow, and acorn all seem to have missed this. (But not TypeScript or XS!) We should probably call it out with a big note in the spec, or, since it might now be web reality, possibly change the spec to match implementations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs editorial changesneeds test262 testsThe proposal should specify how to test an implementation. Ideally via github.com/tc39/test262

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions