Showing the changes to src/core/chuck_frame.cpp (1 of 17 files). Show all
Unified · Split
| @@ -100,7 +100,7 @@ void Chuck_Frame::push_scope( ) · 99 unmodified lines | ||
| 100 | 100 | // name: get_scope() |
| 101 | 101 | // desc: get current scope (added 1.3.0.0) |
| 102 | 102 | //----------------------------------------------------------------------------- |
| 103 | −void Chuck_Frame::get_scope( vector<Chuck_Local *> & out ) const | |
| 103 | +void Chuck_Frame::get_scope( vector<Chuck_Local *> & out, bool localOnly ) const | |
| 104 | 104 | { |
| 105 | 105 | // sanity |
| 106 | 106 | assert( this->stack.size() > 0 ); |
| @@ -111,8 +111,13 @@ void Chuck_Frame::get_scope( vector<Chuck_Local *> & out ) const · 4 unmodified lines | ||
| 111 | 111 | t_CKINT index = this->stack.size() - 1; |
| 112 | 112 | |
| 113 | 113 | // loop |
| 114 | − while( index >= 0 && this->stack[index] != NULL ) | |
| 114 | + while( index >= 0 ) | |
| 115 | 115 | { |
| 116 | + // did we hit a stack boundary (delineated by NULL) | |
| 117 | + // localOnly option added 1.4.2.1 (ge) -- to get all scope in the frame | |
| 118 | + if( localOnly && this->stack[index] != NULL ) | |
| 119 | + break; | |
| 120 | + | |
| 116 | 121 | // last thing |
| 117 | 122 | local = stack[index]; |
| 118 | 123 | // move |