InitState produces an EvalState instance and bundles it into the ExecutionFrame in a way which is not visible to expression evaluation.
(frame *ExecutionFrame)
| 121 | // InitState produces an EvalState instance and bundles it into the ExecutionFrame in a way which is |
| 122 | // not visible to expression evaluation. |
| 123 | func (et *evalStateFactory) InitState(frame *ExecutionFrame) (any, error) { |
| 124 | state := et.factory() |
| 125 | if frame.ctx == nil { |
| 126 | frame.ctx = evalContextPool.Get().(*evalContext) |
| 127 | } |
| 128 | frame.ctx.state = state |
| 129 | return state, nil |
| 130 | } |
| 131 | |
| 132 | // GetState extracts the EvalState from the Activation. |
| 133 | func (et *evalStateFactory) GetState(frame *ExecutionFrame) any { |