Parent implements the Activation interface by proxying to the parent frame or scope.
()
| 280 | |
| 281 | // Parent implements the Activation interface by proxying to the parent frame or scope. |
| 282 | func (f *ExecutionFrame) Parent() Activation { |
| 283 | if f.parent != nil { |
| 284 | if f.parent.scope != nil { |
| 285 | return f.parent.scope |
| 286 | } |
| 287 | return f.parent |
| 288 | } |
| 289 | if f.scope != nil { |
| 290 | return f.scope.Parent() |
| 291 | } |
| 292 | return nil |
| 293 | } |
| 294 | |
| 295 | // ResolveFunction implements the FunctionActivation interface using the bindings resolved when |
| 296 | // the evaluation began, so the cost of a lookup does not depend on the number of enclosing scopes. |