@@ -88,19 +88,14 @@ impl<'a> VarDeclarationsStore<'a> {
8888
8989 /// Add a `var` declaration to be inserted at top of current enclosing statement block,
9090 /// given a `BoundIdentifier`.
91- pub fn insert_var (
92- & self ,
93- binding : & BoundIdentifier < ' a > ,
94- init : Option < Expression < ' a > > ,
95- ctx : & TraverseCtx < ' a > ,
96- ) {
91+ #[ inline]
92+ pub fn insert_var ( & self , binding : & BoundIdentifier < ' a > , ctx : & TraverseCtx < ' a > ) {
9793 let pattern = binding. create_binding_pattern ( ctx) ;
98- self . insert_var_binding_pattern ( pattern, init , ctx) ;
94+ self . insert_var_binding_pattern ( pattern, None , ctx) ;
9995 }
10096
10197 /// Add a `var` declaration with the given init expression to be inserted at top of
10298 /// current enclosing statement block, given a `BoundIdentifier`.
103- #[ expect( unused) ]
10499 #[ inline]
105100 pub fn insert_var_with_init (
106101 & self ,
@@ -117,7 +112,7 @@ impl<'a> VarDeclarationsStore<'a> {
117112 #[ inline]
118113 pub fn create_var ( & self , name : & str , ctx : & mut TraverseCtx < ' a > ) -> BoundIdentifier < ' a > {
119114 let binding = ctx. generate_uid_in_current_hoist_scope ( name) ;
120- self . insert_var ( & binding, None , ctx) ;
115+ self . insert_var ( & binding, ctx) ;
121116 binding
122117 }
123118
@@ -132,7 +127,7 @@ impl<'a> VarDeclarationsStore<'a> {
132127 ctx : & mut TraverseCtx < ' a > ,
133128 ) -> BoundIdentifier < ' a > {
134129 let binding = ctx. generate_uid_in_current_hoist_scope ( name) ;
135- self . insert_var ( & binding, Some ( expression) , ctx) ;
130+ self . insert_var_with_init ( & binding, expression, ctx) ;
136131 binding
137132 }
138133
@@ -145,7 +140,7 @@ impl<'a> VarDeclarationsStore<'a> {
145140 ctx : & mut TraverseCtx < ' a > ,
146141 ) -> BoundIdentifier < ' a > {
147142 let binding = ctx. generate_uid_in_current_hoist_scope_based_on_node ( node) ;
148- self . insert_var ( & binding, None , ctx) ;
143+ self . insert_var ( & binding, ctx) ;
149144 binding
150145 }
151146
0 commit comments