Skip to content

Commit d1770ac

Browse files
authored
chore(es/parser): Remove useless check (#10386)
1 parent 3ef2bd1 commit d1770ac

File tree

1 file changed

+5
-6
lines changed
  • crates/swc_ecma_parser/src/parser

1 file changed

+5
-6
lines changed

crates/swc_ecma_parser/src/parser/stmt.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -870,12 +870,7 @@ impl<'a, I: Tokens> Parser<I> {
870870
}
871871

872872
let mut decls = Vec::with_capacity(4);
873-
let mut first = true;
874-
while first || eat!(self, ',') {
875-
if first {
876-
first = false;
877-
}
878-
873+
loop {
879874
let ctx = if should_include_in {
880875
self.ctx() | Context::IncludeInExpr
881876
} else {
@@ -898,6 +893,10 @@ impl<'a, I: Tokens> Parser<I> {
898893
}
899894

900895
decls.push(self.with_ctx(ctx).parse_var_declarator(for_loop, kind)?);
896+
897+
if !eat!(self, ',') {
898+
break;
899+
}
901900
}
902901

903902
if !for_loop && !eat!(self, ';') {

0 commit comments

Comments
 (0)