@@ -45,8 +45,8 @@ impl<'a> Binder<'a> for VariableDeclarator<'a> {
45
45
let mut var_scope_ids = vec ! [ ] ;
46
46
47
47
// Collect all scopes where variable hoisting can occur
48
- for scope_id in builder. scope . scope_ancestors ( target_scope_id) {
49
- let flags = builder. scope . scope_flags ( scope_id) ;
48
+ for scope_id in builder. scoping . scopes . scope_ancestors ( target_scope_id) {
49
+ let flags = builder. scoping . scopes . scope_flags ( scope_id) ;
50
50
if flags. is_var ( ) {
51
51
target_scope_id = scope_id;
52
52
break ;
@@ -68,9 +68,9 @@ impl<'a> Binder<'a> for VariableDeclarator<'a> {
68
68
69
69
// remove current scope binding and add to target scope
70
70
// avoid same symbols appear in multi-scopes
71
- builder. scope . remove_binding ( scope_id, & name) ;
72
- builder. scope . add_binding ( target_scope_id, & name, symbol_id) ;
73
- builder. symbols . symbol_scope_ids [ symbol_id] = target_scope_id;
71
+ builder. scoping . scopes . remove_binding ( scope_id, & name) ;
72
+ builder. scoping . scopes . add_binding ( target_scope_id, & name, symbol_id) ;
73
+ builder. scoping . symbols . symbol_scope_ids [ symbol_id] = target_scope_id;
74
74
break ;
75
75
}
76
76
}
@@ -106,7 +106,7 @@ impl<'a> Binder<'a> for VariableDeclarator<'a> {
106
106
Expression :: ArrowFunctionExpression ( func) => func. pure ,
107
107
_ => false ,
108
108
} {
109
- builder. symbols . no_side_effects . insert ( symbol_id) ;
109
+ builder. scoping . symbols . no_side_effects . insert ( symbol_id) ;
110
110
}
111
111
}
112
112
}
@@ -169,7 +169,7 @@ impl<'a> Binder<'a> for Function<'a> {
169
169
let scope_flags = builder. current_scope_flags ( ) ;
170
170
if let Some ( ident) = & self . id {
171
171
if is_function_part_of_if_statement ( self , builder) {
172
- let symbol_id = builder. symbols . create_symbol (
172
+ let symbol_id = builder. scoping . symbols . create_symbol (
173
173
ident. span ,
174
174
ident. name . into ( ) ,
175
175
SymbolFlags :: Function ,
@@ -215,7 +215,7 @@ impl<'a> Binder<'a> for Function<'a> {
215
215
if let Some ( AstKind :: ObjectProperty ( prop) ) =
216
216
builder. nodes . parent_kind ( builder. current_node_id )
217
217
{
218
- let flags = builder. scope . scope_flags_mut ( current_scope_id) ;
218
+ let flags = builder. scoping . scopes . scope_flags_mut ( current_scope_id) ;
219
219
match prop. kind {
220
220
PropertyKind :: Get => * flags |= ScopeFlags :: GetAccessor ,
221
221
PropertyKind :: Set => * flags |= ScopeFlags :: SetAccessor ,
@@ -226,7 +226,7 @@ impl<'a> Binder<'a> for Function<'a> {
226
226
// Save `@__NO_SIDE_EFFECTS__`
227
227
if self . pure {
228
228
if let Some ( symbold_id) = self . id . as_ref ( ) . and_then ( |id| id. symbol_id . get ( ) ) {
229
- builder. symbols . no_side_effects . insert ( symbold_id) ;
229
+ builder. scoping . symbols . no_side_effects . insert ( symbold_id) ;
230
230
}
231
231
}
232
232
}
@@ -439,17 +439,17 @@ impl<'a> Binder<'a> for TSModuleDeclaration<'a> {
439
439
440
440
impl < ' a > Binder < ' a > for TSTypeParameter < ' a > {
441
441
fn bind ( & self , builder : & mut SemanticBuilder ) {
442
- let scope_id = if matches ! (
443
- builder . nodes . parent_kind ( builder . current_node_id ) ,
444
- Some ( AstKind :: TSInferType ( _ ) )
445
- ) {
446
- builder
447
- . scope
448
- . scope_ancestors ( builder . current_scope_id )
449
- . find ( |scope_id| builder . scope . scope_flags ( * scope_id ) . is_ts_conditional ( ) )
450
- } else {
451
- None
452
- } ;
442
+ let scope_id =
443
+ if matches ! (
444
+ builder . nodes . parent_kind ( builder . current_node_id ) ,
445
+ Some ( AstKind :: TSInferType ( _ ) )
446
+ ) {
447
+ builder . scoping . scopes . scope_ancestors ( builder . current_scope_id ) . find ( |scope_id| {
448
+ builder . scoping . scopes . scope_flags ( * scope_id ) . is_ts_conditional ( )
449
+ } )
450
+ } else {
451
+ None
452
+ } ;
453
453
454
454
let symbol_id = builder. declare_symbol_on_scope (
455
455
self . name . span ,
0 commit comments