@@ -282,9 +282,41 @@ where
282
282
283
283
unit ! ( visit_mut_private_method, PrivateMethod ) ;
284
284
285
- unit ! ( visit_mut_fn_decl, FnDecl , true ) ;
285
+ fn visit_mut_fn_decl ( & mut self , n : & mut FnDecl ) {
286
+ if !self . config . ignore_eval && contains_eval ( n, true ) {
287
+ n. visit_mut_children_with ( self ) ;
288
+ } else {
289
+ let id = n. ident . to_id ( ) ;
290
+ let inserted = self . preserved . insert ( id. clone ( ) ) ;
291
+ let map = self . get_map ( n, true , false , false ) ;
292
+
293
+ if inserted {
294
+ self . preserved . remove ( & id) ;
295
+ }
296
+
297
+ if !map. is_empty ( ) {
298
+ n. visit_mut_with ( & mut rename_with_config ( & map, self . config . clone ( ) ) ) ;
299
+ }
300
+ }
301
+ }
286
302
287
- unit ! ( visit_mut_class_decl, ClassDecl , true ) ;
303
+ fn visit_mut_class_decl ( & mut self , n : & mut ClassDecl ) {
304
+ if !self . config . ignore_eval && contains_eval ( n, true ) {
305
+ n. visit_mut_children_with ( self ) ;
306
+ } else {
307
+ let id = n. ident . to_id ( ) ;
308
+ let inserted = self . preserved . insert ( id. clone ( ) ) ;
309
+ let map = self . get_map ( n, true , false , false ) ;
310
+
311
+ if inserted {
312
+ self . preserved . remove ( & id) ;
313
+ }
314
+
315
+ if !map. is_empty ( ) {
316
+ n. visit_mut_with ( & mut rename_with_config ( & map, self . config . clone ( ) ) ) ;
317
+ }
318
+ }
319
+ }
288
320
289
321
fn visit_mut_default_decl ( & mut self , n : & mut DefaultDecl ) {
290
322
match n {
0 commit comments