@@ -90,7 +90,7 @@ impl<'a> IsolatedDeclarations<'a> {
90
90
self . ast . class_element_property_definition (
91
91
property. r#type ,
92
92
property. span ,
93
- self . ast . new_vec ( ) ,
93
+ self . ast . vec ( ) ,
94
94
self . ast . copy ( & property. key ) ,
95
95
value,
96
96
property. computed ,
@@ -130,7 +130,7 @@ impl<'a> IsolatedDeclarations<'a> {
130
130
self . ast . class_element_method_definition (
131
131
definition. r#type ,
132
132
definition. span ,
133
- self . ast . new_vec ( ) ,
133
+ self . ast . vec ( ) ,
134
134
self . ast . copy ( & definition. key ) ,
135
135
value,
136
136
definition. kind ,
@@ -153,7 +153,7 @@ impl<'a> IsolatedDeclarations<'a> {
153
153
self . ast . class_element_property_definition (
154
154
r#type,
155
155
SPAN ,
156
- self . ast . new_vec ( ) ,
156
+ self . ast . vec ( ) ,
157
157
key,
158
158
None ,
159
159
false ,
@@ -181,7 +181,7 @@ impl<'a> IsolatedDeclarations<'a> {
181
181
Some ( self . ast . class_element_property_definition (
182
182
PropertyDefinitionType :: PropertyDefinition ,
183
183
param. span ,
184
- self . ast . new_vec ( ) ,
184
+ self . ast . vec ( ) ,
185
185
key,
186
186
None ,
187
187
false ,
@@ -219,7 +219,7 @@ impl<'a> IsolatedDeclarations<'a> {
219
219
let params = self . ast . alloc_formal_parameters (
220
220
SPAN ,
221
221
FormalParameterKind :: Signature ,
222
- self . ast . new_vec ( ) ,
222
+ self . ast . vec ( ) ,
223
223
Option :: < BindingRestElement > :: None ,
224
224
) ;
225
225
self . transform_class_method_definition ( method, params, None )
@@ -239,7 +239,7 @@ impl<'a> IsolatedDeclarations<'a> {
239
239
function : & Function < ' a > ,
240
240
params : & FormalParameters < ' a > ,
241
241
) -> oxc_allocator:: Vec < ' a , ClassElement < ' a > > {
242
- let mut elements = self . ast . new_vec ( ) ;
242
+ let mut elements = self . ast . vec ( ) ;
243
243
for ( index, param) in function. params . items . iter ( ) . enumerate ( ) {
244
244
if param. accessibility . is_some ( ) || param. readonly {
245
245
let type_annotation = if param. accessibility . is_some_and ( |a| a. is_private ( ) ) {
@@ -278,7 +278,7 @@ impl<'a> IsolatedDeclarations<'a> {
278
278
let Some ( name) = method. key . static_name ( ) else {
279
279
continue ;
280
280
} ;
281
- let name = self . ast . new_atom ( & name) ;
281
+ let name = self . ast . atom ( & name) ;
282
282
if inferred_accessor_types. contains_key ( & name) {
283
283
// We've inferred that accessor type already
284
284
continue ;
@@ -337,7 +337,7 @@ impl<'a> IsolatedDeclarations<'a> {
337
337
}
338
338
339
339
let mut has_private_key = false ;
340
- let mut elements = self . ast . new_vec ( ) ;
340
+ let mut elements = self . ast . vec ( ) ;
341
341
let mut is_function_overloads = false ;
342
342
for element in & decl. body . body {
343
343
match element {
@@ -373,7 +373,7 @@ impl<'a> IsolatedDeclarations<'a> {
373
373
self . transform_set_accessor_params (
374
374
& function. params ,
375
375
inferred_accessor_types
376
- . get ( & self . ast . new_atom ( & n) )
376
+ . get ( & self . ast . atom ( & n) )
377
377
. map ( |t| self . ast . copy ( t) ) ,
378
378
)
379
379
} ,
@@ -403,7 +403,7 @@ impl<'a> IsolatedDeclarations<'a> {
403
403
MethodDefinitionKind :: Get => {
404
404
let rt = method. key . static_name ( ) . and_then ( |name| {
405
405
inferred_accessor_types
406
- . get ( & self . ast . new_atom ( & name) )
406
+ . get ( & self . ast . atom ( & name) )
407
407
. map ( |t| self . ast . copy ( t) )
408
408
} ) ;
409
409
if rt. is_none ( ) {
@@ -448,7 +448,7 @@ impl<'a> IsolatedDeclarations<'a> {
448
448
None ,
449
449
property. computed ,
450
450
property. r#static ,
451
- self . ast . new_vec ( ) ,
451
+ self . ast . vec ( ) ,
452
452
) ;
453
453
elements. push ( new_element) ;
454
454
}
@@ -462,7 +462,7 @@ impl<'a> IsolatedDeclarations<'a> {
462
462
// Prevents other classes with the same public members from being used in place of the current class
463
463
let ident = self . ast . property_key_private_identifier ( SPAN , "private" ) ;
464
464
let r#type = PropertyDefinitionType :: PropertyDefinition ;
465
- let decorators = self . ast . new_vec ( ) ;
465
+ let decorators = self . ast . vec ( ) ;
466
466
let element = self . ast . class_element_property_definition (
467
467
r#type,
468
468
SPAN ,
@@ -488,7 +488,7 @@ impl<'a> IsolatedDeclarations<'a> {
488
488
Some ( self . ast . alloc_class (
489
489
decl. r#type ,
490
490
decl. span ,
491
- self . ast . new_vec ( ) ,
491
+ self . ast . vec ( ) ,
492
492
self . ast . copy ( & decl. id ) ,
493
493
self . ast . copy ( & decl. super_class ) ,
494
494
body,
@@ -525,8 +525,8 @@ impl<'a> IsolatedDeclarations<'a> {
525
525
) -> Box < ' a , FormalParameters < ' a > > {
526
526
let pattern = BindingPattern { kind, type_annotation, optional : false } ;
527
527
let parameter =
528
- self . ast . formal_parameter ( SPAN , pattern, None , false , false , self . ast . new_vec ( ) ) ;
529
- let items = self . ast . new_vec_single ( parameter) ;
528
+ self . ast . formal_parameter ( SPAN , pattern, None , false , false , self . ast . vec ( ) ) ;
529
+ let items = self . ast . vec1 ( parameter) ;
530
530
self . ast . alloc_formal_parameters (
531
531
SPAN ,
532
532
FormalParameterKind :: Signature ,
0 commit comments