Exec implements the Interpretable interface method and pushes a new frame onto the execution frame for the duration of the block execution.
(frame *interpreter.ExecutionFrame)
| 226 | // Exec implements the Interpretable interface method and pushes a new frame onto the |
| 227 | // execution frame for the duration of the block execution. |
| 228 | func (b *dynamicBlock) Exec(frame *interpreter.ExecutionFrame) ref.Val { |
| 229 | sa := b.slotActivationPool.Get().(*dynamicSlotActivation) |
| 230 | sa.frame = frame.Push(sa) |
| 231 | // Ensure the 'unwrapped' Activation points to the original one from the frame, |
| 232 | // and not the hierarchical activation which composes the original and the slot |
| 233 | // activation. |
| 234 | sa.Activation = frame.Activation |
| 235 | defer sa.frame.Pop() |
| 236 | defer b.clearSlots(sa) |
| 237 | return b.expr.Exec(sa.frame) |
| 238 | } |
| 239 | |
| 240 | // Eval implements the Interpretable interface method. |
| 241 | func (b *dynamicBlock) Eval(activation cel.Activation) ref.Val { |