@@ -7,7 +7,7 @@ use swc_atoms::Atom;
77use swc_common:: { util:: take:: Take , Span , Spanned , DUMMY_SP } ;
88use swc_ecma_ast:: * ;
99use swc_ecma_transforms_base:: { fixer:: fixer, hygiene:: hygiene} ;
10- use swc_ecma_utils:: { stack_size :: maybe_grow_default , DropSpan , ModuleItemLike , StmtLike , Value } ;
10+ use swc_ecma_utils:: { DropSpan , ModuleItemLike , StmtLike , Value } ;
1111use swc_ecma_visit:: { noop_visit_type, visit_mut_pass, visit_obj_and_computed, Visit , VisitWith } ;
1212
1313pub ( crate ) mod base54;
@@ -476,48 +476,6 @@ pub fn now() -> Option<Instant> {
476476 }
477477}
478478
479- pub ( crate ) fn contains_eval < N > ( node : & N , include_with : bool ) -> bool
480- where
481- N : VisitWith < EvalFinder > ,
482- {
483- let mut v = EvalFinder {
484- found : false ,
485- include_with,
486- } ;
487-
488- node. visit_with ( & mut v) ;
489- v. found
490- }
491-
492- pub ( crate ) struct EvalFinder {
493- found : bool ,
494- include_with : bool ,
495- }
496-
497- impl Visit for EvalFinder {
498- noop_visit_type ! ( ) ;
499-
500- visit_obj_and_computed ! ( ) ;
501-
502- fn visit_expr ( & mut self , n : & Expr ) {
503- maybe_grow_default ( || n. visit_children_with ( self ) ) ;
504- }
505-
506- fn visit_ident ( & mut self , i : & Ident ) {
507- if i. sym == "eval" {
508- self . found = true ;
509- }
510- }
511-
512- fn visit_with_stmt ( & mut self , s : & WithStmt ) {
513- if self . include_with {
514- self . found = true ;
515- } else {
516- s. visit_children_with ( self ) ;
517- }
518- }
519- }
520-
521479#[ allow( unused) ]
522480pub ( crate ) fn dump_program ( p : & Program ) -> String {
523481 #[ cfg( feature = "debug" ) ]
0 commit comments