getSelfBinding resolves the self construct
()
| 185 | |
| 186 | // getSelfBinding resolves the self construct |
| 187 | func (s *callStack) getSelfBinding() selfBinding { |
| 188 | for i := len(s.stack) - 1; i >= 0; i-- { |
| 189 | if s.stack[i].cleanEnv { |
| 190 | return s.stack[i].env.selfBinding |
| 191 | } |
| 192 | } |
| 193 | panic(fmt.Sprintf("malformed stack %v", dumpCallStack(s))) |
| 194 | } |
| 195 | |
| 196 | // lookUpVar finds for the closest variable in scope that matches the given name. |
| 197 | func (s *callStack) lookUpVar(id ast.Identifier) *cachedThunk { |
no test coverage detected