MCPcopy Create free account
hub / github.com/cel-expr/cel-go / InitState

Method InitState

interpreter/interpreter.go:128–138  ·  view source on GitHub ↗

InitState produces an EvalState instance and bundles it into the ExecutionFrame in a way which is not visible to expression evaluation.

(frame *ExecutionFrame)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected