benjamn / ast-types

Esprima-compatible implementation of the Mozilla JS Parser API
MIT License
1.14k stars 197 forks source link

await is a unary expression now #113

Open gabelevi opened 9 years ago

gabelevi commented 9 years ago

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

benjamn commented 9 years ago

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.