Exec implements the InterpretableV2 interface method.
(frame *ExecutionFrame)
| 242 | |
| 243 | // Exec implements the InterpretableV2 interface method. |
| 244 | func (test *evalTestOnly) Exec(frame *ExecutionFrame) ref.Val { |
| 245 | val, err := test.Resolve(frame) |
| 246 | // Return an error if the resolve step fails |
| 247 | if err != nil { |
| 248 | return types.LabelErrNode(test.id, types.WrapErr(err)) |
| 249 | } |
| 250 | if optVal, isOpt := val.(*types.Optional); isOpt { |
| 251 | return types.Bool(optVal.HasValue()) |
| 252 | } |
| 253 | return test.Adapter().NativeToValue(val) |
| 254 | } |
| 255 | |
| 256 | // Eval implements the Interpretable interface method. |
| 257 | func (test *evalTestOnly) Eval(ctx Activation) ref.Val { |
no test coverage detected