benjamn / ast-types

Esprima-compatible implementation of the Mozilla JS Parser API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

await is a unary expression now

gabelevi opened this issue · comments

Async/await now has a semi-official posted draft spec and they've decided to make await foo a unary expression.

Any opinion on how to move forward? Support definitions for both AwaitExpression and add await to UnaryOperators in es7.js?

CC @nmote

Yep, I think that's reasonable. In particular, there is no immediate need to deprecate AwaitExpression. This library is designed so that AwaitExpression and await-as-UnaryOperator can coexist in the type space for as long as both are useful.