diff --git a/boa_parser/src/parser/expression/assignment/mod.rs b/boa_parser/src/parser/expression/assignment/mod.rs index ed66cff608f..d84160c7b41 100644 --- a/boa_parser/src/parser/expression/assignment/mod.rs +++ b/boa_parser/src/parser/expression/assignment/mod.rs @@ -241,7 +241,7 @@ where cursor.set_goal(InputElement::RegExp); if let Some(target) = AssignTarget::from_expression(&lhs, cursor.strict()) { - if let AssignTarget::Identifier(ident) = target { + if let Expression::Identifier(ident) = lhs { self.name = Some(ident); } let expr = self.parse(cursor, interner)?;