fix(parser): parse [+In] in object binding initializer (#874)

closes #873
This commit is contained in:
Boshen 2023-09-09 14:54:20 +08:00 committed by GitHub
parent 28f728f0c0
commit 7c8e6ab6f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -93,7 +93,7 @@ impl<'a> Parser<'a> {
let binding_identifier = BindingIdentifier::new(ident.name.clone(), ident.span); let binding_identifier = BindingIdentifier::new(ident.name.clone(), ident.span);
let identifier = self.ast.binding_identifier(binding_identifier); let identifier = self.ast.binding_identifier(binding_identifier);
let left = self.ast.binding_pattern(identifier, None, false); let left = self.ast.binding_pattern(identifier, None, false);
self.parse_initializer(span, left)? self.with_context(Context::In, |p| p.parse_initializer(span, left))?
} else { } else {
return Err(self.unexpected()); return Err(self.unexpected());
} }

View file

@ -9,3 +9,5 @@ for(new null(null in null);;);
for(var[l=null in null]in null); for(var[l=null in null]in null);
for(`${null in null}`;;); for(`${null in null}`;;);
for(var{async=null in null}of null); // #873