InitState produces an EvalState instance and bundles it into the ExecutionFrame in a way which is not visible to expression evaluation.
(frame *ExecutionFrame)
| 127 | // InitState produces an EvalState instance and bundles it into the ExecutionFrame in a way which is |
| 128 | // not visible to expression evaluation. |
| 129 | func (et *evalStateFactory) InitState(frame *ExecutionFrame) (any, error) { |
| 130 | if frame.ctx != nil && frame.ctx.state != nil { |
| 131 | return frame.ctx.state, nil |
| 132 | } |
| 133 | state := et.factory() |
| 134 | if frame.ctx == nil { |
| 135 | frame.ctx = evalContextPool.Get().(*evalContext) |
| 136 | } |
| 137 | frame.ctx.state = state |
| 138 | return state, nil |
| 139 | } |
| 140 | |
| 141 | // GetState extracts the EvalState from the Activation. |
| 142 | func (et *evalStateFactory) GetState(frame *ExecutionFrame) any { |