Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(transformer/class-properties): shorten code #7804

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading