@@ -5,15 +5,13 @@ This Source Code Form is subject to the terms of the
55at http://mozilla.org/MPL/2.0/.
66----------------------------------------------------------*/
77using System ;
8- using System . Collections ;
9- using System . Collections . Generic ;
108using System . Runtime . Serialization ;
119using Newtonsoft . Json ;
1210
1311namespace OneScript . DebugProtocol
1412{
1513 [ DataContract , JsonObject , Serializable ]
16- public class StackFrame : IVariableLocator
14+ public class StackFrame
1715 {
1816 [ DataMember ]
1917 public int Index { get ; set ; }
@@ -27,85 +25,6 @@ public class StackFrame : IVariableLocator
2725 [ DataMember ]
2826 public string Source { get ; set ; }
2927
30- [ DataMember ]
31- public Variable [ ] Variables { get ; set ; }
32-
3328 public int ThreadId { get ; set ; }
34-
35- int IVariableLocator . Count
36- {
37- get
38- {
39- if ( Variables == null )
40- return 0 ;
41-
42- return Variables . Length ;
43- }
44- }
45-
46- Variable IVariableLocator . this [ int index ]
47- {
48- get
49- {
50- if ( Variables == null )
51- throw new ArgumentOutOfRangeException ( ) ;
52-
53- return Variables [ index ] ;
54- }
55- }
56-
57- IEnumerator < Variable > IEnumerable < Variable > . GetEnumerator ( )
58- {
59- if ( Variables == null )
60- {
61- return EmptyEnumerator < Variable > . Instance ;
62- }
63-
64- return ( ( IEnumerable < Variable > ) Variables ) . GetEnumerator ( ) ;
65- }
66-
67- IEnumerator IEnumerable . GetEnumerator ( )
68- {
69- return ( ( IVariableLocator ) this ) . GetEnumerator ( ) ;
70- }
71-
72- void IVariableLocator . Hydrate ( IDebuggerService process )
73- {
74- if ( Variables != null )
75- return ;
76- var variables = process . GetVariables ( ThreadId , Index , Array . Empty < int > ( ) ) ;
77- Variables = variables ;
78- }
79-
80- public IVariableLocator CreateChildLocator ( int variableIndex )
81- {
82- return new VariableLocator ( ThreadId , Index , variableIndex ) ;
83- }
84- }
85-
86- internal class EmptyEnumerator < T > : IEnumerator < T >
87- {
88- public static EmptyEnumerator < T > Instance { get ; } = new EmptyEnumerator < T > ( ) ;
89-
90- private EmptyEnumerator ( )
91- {
92- }
93-
94- public bool MoveNext ( )
95- {
96- return false ;
97- }
98-
99- public void Reset ( )
100- {
101- }
102-
103- public T Current { get ; } = default ;
104-
105- object IEnumerator . Current => Current ;
106-
107- public void Dispose ( )
108- {
109- }
11029 }
11130}
0 commit comments