@@ -319,29 +319,23 @@ impl<'a> Traverse<'a> for ExplicitResourceManagement<'a, '_> {
319319 _ => decl. into_expression ( ) ,
320320 } ;
321321
322- inner_block. push ( Statement :: VariableDeclaration ( ctx . ast . alloc (
323- ctx. ast . variable_declaration (
322+ inner_block. push ( Statement :: VariableDeclaration (
323+ ctx. ast . alloc_variable_declaration (
324324 span,
325325 VariableDeclarationKind :: Var ,
326326 ctx. ast . vec1 ( ctx. ast . variable_declarator (
327327 span,
328328 VariableDeclarationKind :: Var ,
329- ctx. ast . binding_pattern (
330- BindingPatternKind :: BindingIdentifier (
331- ctx. ast . alloc ( var_id. create_binding_identifier ( ctx) ) ,
332- ) ,
333- NONE ,
334- false ,
335- ) ,
329+ var_id. create_binding_pattern ( ctx) ,
336330 Some ( expr) ,
337331 false ,
338332 ) ) ,
339333 false ,
340334 ) ,
341- ) ) ) ;
335+ ) ) ;
342336
343- program_body. push ( Statement :: ExportNamedDeclaration ( ctx . ast . alloc (
344- ctx. ast . export_named_declaration (
337+ program_body. push ( Statement :: ExportNamedDeclaration (
338+ ctx. ast . alloc_export_named_declaration (
345339 SPAN ,
346340 None ,
347341 ctx. ast . vec1 ( ctx. ast . export_specifier (
@@ -356,7 +350,7 @@ impl<'a> Traverse<'a> for ExplicitResourceManagement<'a, '_> {
356350 ImportOrExportKind :: Value ,
357351 NONE ,
358352 ) ,
359- ) ) ) ;
353+ ) ) ;
360354 }
361355 Statement :: ExportNamedDeclaration ( ref mut export_named_declaration) => {
362356 let Some ( ref mut decl) = export_named_declaration. declaration else {
@@ -443,16 +437,16 @@ impl<'a> Traverse<'a> for ExplicitResourceManagement<'a, '_> {
443437 _ => unreachable ! ( ) ,
444438 } ;
445439
446- program_body. push ( Statement :: ExportNamedDeclaration ( ctx . ast . alloc (
447- ctx. ast . export_named_declaration (
440+ program_body. push ( Statement :: ExportNamedDeclaration (
441+ ctx. ast . alloc_export_named_declaration (
448442 SPAN ,
449443 None ,
450444 export_specifiers,
451445 None ,
452446 export_named_declaration. export_kind ,
453447 NONE ,
454448 ) ,
455- ) ) ) ;
449+ ) ) ;
456450 }
457451 Statement :: ClassDeclaration ( class_decl) => {
458452 inner_block. push ( Self :: transform_class_decl ( class_decl. unbox ( ) , ctx) ) ;
@@ -493,9 +487,7 @@ impl<'a> Traverse<'a> for ExplicitResourceManagement<'a, '_> {
493487 ctx. scoping_mut ( ) . change_scope_parent_id ( * id, Some ( block_scope_id) ) ;
494488 }
495489
496- program_body. push ( Statement :: BlockStatement (
497- ctx. ast . alloc ( ctx. ast . block_statement_with_scope_id ( SPAN , inner_block, block_scope_id) ) ,
498- ) ) ;
490+ program_body. push ( ctx. ast . statement_block_with_scope_id ( SPAN , inner_block, block_scope_id) ) ;
499491
500492 std:: mem:: swap ( & mut node. body , & mut program_body) ;
501493 }
@@ -787,13 +779,12 @@ impl<'a> ExplicitResourceManagement<'a, '_> {
787779 ctx. ast . expression_assignment (
788780 SPAN ,
789781 AssignmentOperator :: Assign ,
790- SimpleAssignmentTarget :: from ( ctx. ast . member_expression_static (
782+ AssignmentTarget :: from ( ctx. ast . member_expression_static (
791783 SPAN ,
792784 using_ctx. create_read_expression ( ctx) ,
793785 ctx. ast . identifier_name ( SPAN , "e" ) ,
794786 false ,
795- ) )
796- . into ( ) ,
787+ ) ) ,
797788 ident. create_read_expression ( ctx) ,
798789 ) ,
799790 ) ;
@@ -850,7 +841,7 @@ impl<'a> ExplicitResourceManagement<'a, '_> {
850841
851842 * ctx. scoping_mut ( ) . symbol_flags_mut ( id. symbol_id ( ) ) = SymbolFlags :: FunctionScopedVariable ;
852843
853- Statement :: VariableDeclaration ( ctx. ast . alloc ( ctx . ast . variable_declaration (
844+ Statement :: VariableDeclaration ( ctx. ast . alloc_variable_declaration (
854845 SPAN ,
855846 VariableDeclarationKind :: Var ,
856847 ctx. ast . vec1 ( ctx. ast . variable_declarator (
@@ -865,6 +856,6 @@ impl<'a> ExplicitResourceManagement<'a, '_> {
865856 false ,
866857 ) ) ,
867858 false ,
868- ) ) )
859+ ) )
869860 }
870861}
0 commit comments