Skip to content

Commit

Permalink
Don't wrap class expression in sequence expr if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 18, 2024
1 parent f4313c5 commit bde1e67
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/oxc_transformer/src/es2022/class_properties/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,12 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
expr_count += private_props.len();
}

// TODO: Why is this assertion failing sometimes?
// debug_assert!(expr_count > 0);
// TODO: Refactor
if expr_count == 0 {
debug_assert!(class_details.bindings.temp.is_none());
self.classes_stack.pop();
return;
}

expr_count += 1 + usize::from(class_details.bindings.temp.is_some());

Expand Down

0 comments on commit bde1e67

Please sign in to comment.