Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions crates/oxc_ast/src/ast_builder_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,24 @@ impl<'a> AstBuilder<'a> {
mem::replace(function, empty_function)
}

/// Move a class out by replacing it with an empty [`Class`].
pub fn move_class(self, class: &mut Class<'a>) -> Class<'a> {
let empty_class = self.class(
SPAN,
ClassType::ClassDeclaration,
self.vec(),
None,
NONE,
None,
NONE,
None,
self.class_body(SPAN, self.vec()),
false,
false,
);
mem::replace(class, empty_class)
}

/// Move an array element out by replacing it with an [`ArrayExpressionElement::Elision`].
pub fn move_array_expression_element(
self,
Expand Down
4 changes: 4 additions & 0 deletions crates/oxc_transformer/src/common/helper_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ pub enum Helper {
ReadOnlyError,
WriteOnlyError,
CheckInRHS,
Decorate,
DecorateParam,
}

impl Helper {
Expand Down Expand Up @@ -193,6 +195,8 @@ impl Helper {
Self::ReadOnlyError => "readOnlyError",
Self::WriteOnlyError => "writeOnlyError",
Self::CheckInRHS => "checkInRHS",
Self::Decorate => "decorate",
Self::DecorateParam => "decorateParam",
}
}
}
Expand Down
Loading
Loading