@@ -3,7 +3,6 @@ import type {
3
3
DynamicScope ,
4
4
Nullable ,
5
5
Owner ,
6
- PartialScope ,
7
6
Scope ,
8
7
ScopeBlock ,
9
8
ScopeSlot ,
@@ -42,28 +41,26 @@ export function isScopeReference(s: ScopeSlot): s is Reference {
42
41
return true ;
43
42
}
44
43
45
- export class PartialScopeImpl implements PartialScope {
46
- static root ( self : Reference < unknown > , size = 0 , owner : Owner ) : PartialScope {
44
+ export class ScopeImpl implements Scope {
45
+ static root ( self : Reference < unknown > , size = 0 , owner : Owner ) : Scope {
47
46
let refs : Reference < unknown > [ ] = new Array ( size + 1 ) . fill ( UNDEFINED_REFERENCE ) ;
48
47
49
- return new PartialScopeImpl ( refs , owner , null , null , null ) . init ( { self } ) ;
48
+ return new ScopeImpl ( refs , owner , null , null ) . init ( { self } ) ;
50
49
}
51
50
52
51
static sized ( size = 0 , owner : Owner ) : Scope {
53
52
let refs : Reference < unknown > [ ] = new Array ( size + 1 ) . fill ( UNDEFINED_REFERENCE ) ;
54
53
55
- return new PartialScopeImpl ( refs , owner , null , null , null ) ;
54
+ return new ScopeImpl ( refs , owner , null , null ) ;
56
55
}
57
56
58
57
constructor (
59
58
// the 0th slot is `self`
60
59
readonly slots : Array < ScopeSlot > ,
61
60
readonly owner : Owner ,
62
61
private callerScope : Scope | null ,
63
- // named arguments and blocks passed to a layout that uses eval
64
- private evalScope : Dict < ScopeSlot > | null ,
65
- // locals in scope when the partial was invoked
66
- private partialMap : Dict < Reference < unknown > > | null
62
+ // named arguments and blocks passed to a layout that uses debugger
63
+ private debuggerScope : Dict < ScopeSlot > | null
67
64
) { }
68
65
69
66
init ( { self } : { self : Reference < unknown > } ) : this {
@@ -84,12 +81,8 @@ export class PartialScopeImpl implements PartialScope {
84
81
return block === UNDEFINED_REFERENCE ? null : ( block as ScopeBlock ) ;
85
82
}
86
83
87
- getEvalScope ( ) : Nullable < Dict < ScopeSlot > > {
88
- return this . evalScope ;
89
- }
90
-
91
- getPartialMap ( ) : Nullable < Dict < Reference < unknown > > > {
92
- return this . partialMap ;
84
+ getDebuggerScope ( ) : Nullable < Dict < ScopeSlot > > {
85
+ return this . debuggerScope ;
93
86
}
94
87
95
88
bind ( symbol : number , value : ScopeSlot ) {
@@ -108,12 +101,8 @@ export class PartialScopeImpl implements PartialScope {
108
101
this . set < Nullable < ScopeBlock > > ( symbol , value ) ;
109
102
}
110
103
111
- bindEvalScope ( map : Nullable < Dict < ScopeSlot > > ) {
112
- this . evalScope = map ;
113
- }
114
-
115
- bindPartialMap ( map : Dict < Reference < unknown > > ) {
116
- this . partialMap = map ;
104
+ bindDebuggerScope ( map : Nullable < Dict < ScopeSlot > > ) {
105
+ this . debuggerScope = map ;
117
106
}
118
107
119
108
bindCallerScope ( scope : Nullable < Scope > ) : void {
@@ -125,13 +114,7 @@ export class PartialScopeImpl implements PartialScope {
125
114
}
126
115
127
116
child ( ) : Scope {
128
- return new PartialScopeImpl (
129
- this . slots . slice ( ) ,
130
- this . owner ,
131
- this . callerScope ,
132
- this . evalScope ,
133
- this . partialMap
134
- ) ;
117
+ return new ScopeImpl ( this . slots . slice ( ) , this . owner , this . callerScope , this . debuggerScope ) ;
135
118
}
136
119
137
120
private get < T extends ScopeSlot > ( index : number ) : T {
0 commit comments