| 269 | } |
| 270 | |
| 271 | absl::Status AbstractFunctionStep::Evaluate(ExecutionFrame* frame) const { |
| 272 | if (!frame->value_stack().HasEnough(num_arguments_)) { |
| 273 | return absl::Status(absl::StatusCode::kInternal, "Value stack underflow"); |
| 274 | } |
| 275 | |
| 276 | // DoEvaluate may return a status for non-recoverable errors (e.g. |
| 277 | // unexpected typing, illegal expression state). Application errors that can |
| 278 | // reasonably be handled as a cel error will appear in the result value. |
| 279 | CEL_ASSIGN_OR_RETURN(auto result, DoEvaluate(frame)); |
| 280 | |
| 281 | frame->value_stack().PopAndPush(num_arguments_, std::move(result)); |
| 282 | |
| 283 | return absl::OkStatus(); |
| 284 | } |
| 285 | |
| 286 | absl::StatusOr<ResolveResult> ResolveStatic( |
| 287 | absl::Span<const cel::Value> input_args, |
no test coverage detected