IsLocalVariable reports whether the variable name is locally bound in the hierarchical activation.
(name string)
| 136 | |
| 137 | // IsLocalVariable reports whether the variable name is locally bound in the hierarchical activation. |
| 138 | func (a *hierarchicalActivation) IsLocalVariable(name string) bool { |
| 139 | if holder, ok := a.child.(localVariableHolder); ok { |
| 140 | if holder.IsLocalVariable(name) { |
| 141 | return true |
| 142 | } |
| 143 | } |
| 144 | if holder, ok := a.parent.(localVariableHolder); ok { |
| 145 | return holder.IsLocalVariable(name) |
| 146 | } |
| 147 | return false |
| 148 | } |
| 149 | |
| 150 | // AsPartialActivation checks the child first via direct type assertion (to |
| 151 | // avoid recursion through the folder → frame → hierarchicalActivation cycle), |
nothing calls this directly
no test coverage detected