File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -488,6 +488,9 @@ impl ModuleMutVisitor {
488488 fn enable_nesting_for_function ( & self , body : & mut Box < Function > ) {
489489 body. visit_mut_children_with ( & mut & mut self . get_nesting_visitor ( ) ) ;
490490 }
491+ fn enable_nesting_for_arrow_function ( & self , body : & mut Box < BlockStmtOrExpr > ) {
492+ body. visit_mut_children_with ( & mut & mut self . get_nesting_visitor ( ) ) ;
493+ }
491494}
492495
493496impl VisitMut for ModuleMutVisitor {
@@ -614,10 +617,12 @@ impl VisitMut for ModuleMutVisitor {
614617 Some ( init) => {
615618 match & mut * * init {
616619 Expr :: Fn ( FnExpr { function, .. } ) => {
620+ // const Index = function () {}
617621 self . enable_nesting_for_function ( function) ;
618622 } ,
619623 Expr :: Arrow ( ArrowExpr { body, .. } ) => {
620- // Todo: support arrow funciton
624+ // const Index = () => {}
625+ self . enable_nesting_for_arrow_function ( body) ;
621626 } ,
622627 _ => ( )
623628 }
You can’t perform that action at this time.
0 commit comments