Skip to content

Commit

Permalink
refactor(transformer/class-properties): shorten code
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 11, 2024
1 parent 6f59d27 commit 9cfa4d3
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -961,11 +961,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
let mut chain_expr = Self::convert_chain_expression_to_expression(expr, ctx);
let result = self
.transform_private_field_expression_of_chain_expression(&mut chain_expr, ctx)
.unwrap_or_else(|| {
unreachable!(
"The ChainExpression must contains at least one optional expression, so it never be `None` here."
)
});
.expect("The ChainExpression must contain at least one optional expression, so it can never be `None` here.");
Some((result, chain_expr))
} else if let Some(result) = self.transform_chain_expression_element(element, ctx) {
let chain_expr = Self::convert_chain_expression_to_expression(expr, ctx);
Expand Down

0 comments on commit 9cfa4d3

Please sign in to comment.