@@ -202,7 +202,9 @@ macro_rules! unit {
202
202
} else {
203
203
let map = self . get_map( n, false , false , false ) ;
204
204
205
- n. visit_mut_with( & mut rename_with_config( & map, self . config. clone( ) ) ) ;
205
+ if !map. is_empty( ) {
206
+ n. visit_mut_with( & mut rename_with_config( & map, self . config. clone( ) ) ) ;
207
+ }
206
208
}
207
209
}
208
210
} ;
@@ -214,7 +216,9 @@ macro_rules! unit {
214
216
} else {
215
217
let map = self . get_map( n, true , false , false ) ;
216
218
217
- n. visit_mut_with( & mut rename_with_config( & map, self . config. clone( ) ) ) ;
219
+ if !map. is_empty( ) {
220
+ n. visit_mut_with( & mut rename_with_config( & map, self . config. clone( ) ) ) ;
221
+ }
218
222
}
219
223
}
220
224
} ;
@@ -246,6 +250,20 @@ where
246
250
247
251
unit ! ( visit_mut_class_decl, ClassDecl , true ) ;
248
252
253
+ fn visit_mut_default_decl ( & mut self , n : & mut DefaultDecl ) {
254
+ match n {
255
+ DefaultDecl :: Class ( n) => {
256
+ n. visit_mut_children_with ( self ) ;
257
+ }
258
+ DefaultDecl :: Fn ( n) => {
259
+ n. visit_mut_children_with ( self ) ;
260
+ }
261
+ DefaultDecl :: TsInterfaceDecl ( n) => {
262
+ n. visit_mut_children_with ( self ) ;
263
+ }
264
+ }
265
+ }
266
+
249
267
fn visit_mut_expr ( & mut self , n : & mut Expr ) {
250
268
maybe_grow_default ( || n. visit_mut_children_with ( self ) ) ;
251
269
}
@@ -284,7 +302,9 @@ where
284
302
m. visit_mut_children_with ( self ) ;
285
303
}
286
304
287
- m. visit_mut_with ( & mut rename_with_config ( & map, self . config . clone ( ) ) ) ;
305
+ if !map. is_empty ( ) {
306
+ m. visit_mut_with ( & mut rename_with_config ( & map, self . config . clone ( ) ) ) ;
307
+ }
288
308
}
289
309
290
310
fn visit_mut_script ( & mut self , m : & mut Script ) {
@@ -300,7 +320,9 @@ where
300
320
m. visit_mut_children_with ( self ) ;
301
321
}
302
322
303
- m. visit_mut_with ( & mut rename_with_config ( & map, self . config . clone ( ) ) ) ;
323
+ if !map. is_empty ( ) {
324
+ m. visit_mut_with ( & mut rename_with_config ( & map, self . config . clone ( ) ) ) ;
325
+ }
304
326
}
305
327
}
306
328
0 commit comments