Skip to content

Commit

Permalink
Refactor: Use AstBuilder::vec_from_array
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Nov 17, 2024
1 parent 780bdf6 commit be17ba1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/oxc_transformer/src/es2022/class_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
}
};

let arguments = ctx.ast.vec_from_iter([
let arguments = ctx.ast.vec_from_array([
Argument::from(assignee),
Argument::from(key),
Argument::from(value),
Expand All @@ -713,7 +713,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
) -> Expression<'a> {
let private_props = self.private_props_stack.last().unwrap();
let prop = &private_props[&ident.name];
let arguments = ctx.ast.vec_from_iter([
let arguments = ctx.ast.vec_from_array([
Argument::from(ctx.ast.expression_this(SPAN)),
Argument::from(prop.binding.create_read_expression(ctx)),
Argument::from(value),
Expand Down Expand Up @@ -976,7 +976,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
// It should already be initialized anyway.
// Need to store `class_name` on stack, because could be from an enclosing class.
let class_binding = self.initialize_class_name_binding(ctx);
let arguments = ctx.ast.vec_from_iter([
let arguments = ctx.ast.vec_from_array([
Argument::from(class_binding.create_read_expression(ctx)),
Argument::from(field_expr.object),
Argument::from(prop_ident),
Expand All @@ -985,7 +985,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
} else {
// `_classPrivateFieldGet(_prop, this)`
let arguments = [Argument::from(prop_ident), Argument::from(field_expr.object)];
let arguments = ctx.ast.vec_from_iter(arguments);
let arguments = ctx.ast.vec_from_array(arguments);
(Helper::ClassPrivateFieldGet, arguments)
};

Expand Down

0 comments on commit be17ba1

Please sign in to comment.