| 91 | right_(std::move(right)) {} |
| 92 | |
| 93 | absl::Status Evaluate(ExecutionFrameBase& frame, cel::Value& result, |
| 94 | AttributeTrail& attribute) const override { |
| 95 | cel::Value condition; |
| 96 | |
| 97 | AttributeTrail condition_attr; |
| 98 | |
| 99 | CEL_RETURN_IF_ERROR(condition_->Evaluate(frame, condition, condition_attr)); |
| 100 | |
| 101 | if (condition.IsError() || condition.IsUnknown()) { |
| 102 | result = std::move(condition); |
| 103 | attribute = std::move(condition_attr); |
| 104 | return absl::OkStatus(); |
| 105 | } |
| 106 | |
| 107 | if (!condition.IsBool()) { |
| 108 | result = cel::ErrorValue(CreateNoMatchingOverloadError(kTernary)); |
| 109 | return absl::OkStatus(); |
| 110 | } |
| 111 | |
| 112 | if (condition.GetBool().NativeValue()) { |
| 113 | return left_->Evaluate(frame, result, attribute); |
| 114 | } |
| 115 | return right_->Evaluate(frame, result, attribute); |
| 116 | } |
| 117 | |
| 118 | private: |
| 119 | std::unique_ptr<DirectExpressionStep> condition_; |
nothing calls this directly
no test coverage detected