1
Fork 0

Add additional tests and update existing tests

This commit is contained in:
Eric Holk 2023-12-12 17:33:51 -08:00
parent 97df0d3657
commit 397f4a15bb
No known key found for this signature in database
GPG key ID: 8EA6B43ED4CE0911
7 changed files with 111 additions and 2 deletions

View file

@ -2684,7 +2684,8 @@ impl<'a> Parser<'a> {
/// Parses `for await? <src_pat> in <src_expr> <src_loop_block>` (`for` token already eaten).
fn parse_expr_for(&mut self, opt_label: Option<Label>, lo: Span) -> PResult<'a, P<Expr>> {
let is_await = self.eat_keyword(kw::Await);
let is_await =
self.token.uninterpolated_span().at_least_rust_2018() && self.eat_keyword(kw::Await);
if is_await {
self.sess.gated_spans.gate(sym::async_for_loop, self.prev_token.span);