Skip to content

Commit

Permalink
Fix parsing of binding identifier in try catch parameters (#3752)
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad authored Mar 20, 2024
1 parent ddac762 commit abec7b2
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions core/parser/src/parser/statement/try_stm/catch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,9 @@ where
.parse(cursor, interner)?;
Ok(Binding::Pattern(pat.into()))
}
TokenKind::IdentifierName(_) => {
let ident = BindingIdentifier::new(self.allow_yield, self.allow_await)
.parse(cursor, interner)?;
Ok(Binding::Identifier(ident))
}
_ => Err(Error::expected(
[String::from("pattern"), String::from("binding identifier")],
token.to_string(interner),
token.span(),
"catch parameter",
_ => Ok(Binding::Identifier(
BindingIdentifier::new(self.allow_yield, self.allow_await)
.parse(cursor, interner)?,
)),
}
}
Expand Down

0 comments on commit abec7b2

Please sign in to comment.