@@ -67,7 +67,7 @@ pub struct Collect {
67
67
pub should_wrap : bool ,
68
68
/// local variable binding -> descriptor
69
69
pub imports : HashMap < Id , Import > ,
70
- pub this_exprs : HashMap < Id , ( Ident , Span ) > ,
70
+ pub this_exprs : HashMap < JsWord , Span > ,
71
71
/// exported name -> descriptor
72
72
pub exports : HashMap < JsWord , Export > ,
73
73
/// local variable binding -> exported name
@@ -260,8 +260,8 @@ impl Visit for Collect {
260
260
}
261
261
self . in_module_this = false ;
262
262
263
- for ( _key , ( ident , span) ) in std:: mem:: take ( & mut self . this_exprs ) {
264
- if self . exports . contains_key ( & ident . sym ) {
263
+ for ( key , span) in std:: mem:: take ( & mut self . this_exprs ) {
264
+ if self . exports . contains_key ( & key ) {
265
265
self . should_wrap = true ;
266
266
self . add_bailout ( span, BailoutReason :: ThisInExport ) ;
267
267
}
@@ -601,7 +601,7 @@ impl Visit for Collect {
601
601
. or_insert_with ( || node. id . sym . clone ( ) ) ;
602
602
}
603
603
604
- if self . in_assign && node. id . span . has_mark ( self . global_mark ) {
604
+ if self . in_assign && node. id . ctxt . has_mark ( self . global_mark ) {
605
605
self
606
606
. non_const_bindings
607
607
. entry ( id ! ( node. id) )
@@ -627,7 +627,7 @@ impl Visit for Collect {
627
627
. or_insert_with ( || node. key . sym . clone ( ) ) ;
628
628
}
629
629
630
- if self . in_assign && node. key . span . has_mark ( self . global_mark ) {
630
+ if self . in_assign && node. key . ctxt . has_mark ( self . global_mark ) {
631
631
self
632
632
. non_const_bindings
633
633
. entry ( id ! ( node. key) )
@@ -712,7 +712,7 @@ impl Visit for Collect {
712
712
}
713
713
} else if !self . in_class {
714
714
if let MemberProp :: Ident ( prop) = & node. prop {
715
- self . this_exprs . insert ( id ! ( prop) , ( prop . clone ( ) , node. span ) ) ;
715
+ self . this_exprs . insert ( prop. sym . clone ( ) , node. span ) ;
716
716
}
717
717
}
718
718
return ;
@@ -750,7 +750,7 @@ impl Visit for Collect {
750
750
self . add_bailout ( span, BailoutReason :: NonTopLevelRequire ) ;
751
751
}
752
752
753
- if let Some ( source) = match_import ( node, self . ignore_mark ) {
753
+ if let Some ( source) = match_import ( node) {
754
754
self . non_static_requires . insert ( source. clone ( ) ) ;
755
755
self . wrapped_requires . insert ( source. to_string ( ) ) ;
756
756
let span = match node {
@@ -901,7 +901,7 @@ impl Visit for Collect {
901
901
Expr :: Await ( await_exp) => {
902
902
// let x = await import('foo');
903
903
// let {x} = await import('foo');
904
- if let Some ( source) = match_import ( & await_exp. arg , self . ignore_mark ) {
904
+ if let Some ( source) = match_import ( & await_exp. arg ) {
905
905
self . add_pat_imports ( & node. name , & source, ImportKind :: DynamicImport ) ;
906
906
return ;
907
907
}
@@ -929,7 +929,7 @@ impl Visit for Collect {
929
929
}
930
930
Expr :: Member ( member) => {
931
931
// import('foo').then(foo => ...);
932
- if let Some ( source) = match_import ( & member. obj , self . ignore_mark ) {
932
+ if let Some ( source) = match_import ( & member. obj ) {
933
933
if match_property_name ( member) . map_or ( false , |f| & * f. 0 == "then" ) {
934
934
if let Some ( ExprOrSpread { expr, .. } ) = node. args . first ( ) {
935
935
let param = match & * * expr {
0 commit comments