Fixes #1168 in a surprisingly simple way: don't parse if/switch/try/iterations as Statements if they're followed by an AllowedTrailingCallExpression or Pipe operator, leaving them to be parsed as expressions later on.
Also found a simpler way to avoid async do and async for from being parsed as calls to a function async: swapping the order so that ExpressionizedStatement gets checked before UpdateExpression (which includes CallExpression). This brings these into alignment with async function and so on which had no special handling. (This was also a necessary step; the workaround from before didn't work with the rest of this PR.)
Fixes #1168 in a surprisingly simple way: don't parse
if
/switch
/try
/iterations asStatement
s if they're followed by anAllowedTrailingCallExpression
orPipe
operator, leaving them to be parsed as expressions later on.Also found a simpler way to avoid
async do
andasync for
from being parsed as calls to a functionasync
: swapping the order so thatExpressionizedStatement
gets checked beforeUpdateExpression
(which includesCallExpression
). This brings these into alignment withasync function
and so on which had no special handling. (This was also a necessary step; the workaround from before didn't work with the rest of this PR.)