@@ -181,6 +181,22 @@ impl VisitMut for Arrow {
181
181
}
182
182
}
183
183
184
+ fn visit_mut_getter_prop ( & mut self , f : & mut GetterProp ) {
185
+ f. key . visit_mut_with ( self ) ;
186
+
187
+ if let Some ( body) = & mut f. body {
188
+ let old_rep = self . hoister . take ( ) ;
189
+
190
+ body. visit_mut_with ( self ) ;
191
+
192
+ let decl = mem:: replace ( & mut self . hoister , old_rep) . to_stmt ( ) ;
193
+
194
+ if let Some ( stmt) = decl {
195
+ prepend_stmt ( & mut body. stmts , stmt) ;
196
+ }
197
+ }
198
+ }
199
+
184
200
fn visit_mut_module_items ( & mut self , stmts : & mut Vec < ModuleItem > ) {
185
201
stmts. visit_mut_children_with ( self ) ;
186
202
@@ -200,6 +216,23 @@ impl VisitMut for Arrow {
200
216
prepend_stmt ( & mut script. body , stmt) ;
201
217
}
202
218
}
219
+
220
+ fn visit_mut_setter_prop ( & mut self , f : & mut SetterProp ) {
221
+ f. key . visit_mut_with ( self ) ;
222
+ f. param . visit_mut_with ( self ) ;
223
+
224
+ if let Some ( body) = & mut f. body {
225
+ let old_rep = self . hoister . take ( ) ;
226
+
227
+ body. visit_mut_with ( self ) ;
228
+
229
+ let decl = mem:: replace ( & mut self . hoister , old_rep) . to_stmt ( ) ;
230
+
231
+ if let Some ( stmt) = decl {
232
+ prepend_stmt ( & mut body. stmts , stmt) ;
233
+ }
234
+ }
235
+ }
203
236
}
204
237
205
238
impl InjectVars for Arrow {
0 commit comments