Make parse_pat_ident not recover bad name

This commit is contained in:
Esteban Küber 2023-11-06 21:00:13 +00:00
parent abe34e9ab1
commit 44fd3b4d46
8 changed files with 15 additions and 274 deletions

View file

@ -839,7 +839,7 @@ impl<'a> Parser<'a> {
binding_annotation: BindingAnnotation,
syntax_loc: Option<PatternLocation>,
) -> PResult<'a, PatKind> {
let ident = self.parse_ident()?;
let ident = self.parse_ident_common(false)?;
if self.may_recover()
&& !matches!(syntax_loc, Some(PatternLocation::FunctionParameter))