| 51 | }; |
| 52 | |
| 53 | absl::Status CreateListStep::Evaluate(ExecutionFrame* frame) const { |
| 54 | if (list_size_ < 0) { |
| 55 | return absl::Status(absl::StatusCode::kInternal, |
| 56 | "CreateListStep: list size is <0"); |
| 57 | } |
| 58 | |
| 59 | if (!frame->value_stack().HasEnough(list_size_)) { |
| 60 | return absl::Status(absl::StatusCode::kInternal, |
| 61 | "CreateListStep: stack underflow"); |
| 62 | } |
| 63 | |
| 64 | Value result; |
| 65 | CEL_RETURN_IF_ERROR(DoEvaluate(frame, &result)); |
| 66 | |
| 67 | frame->value_stack().PopAndPush(list_size_, std::move(result)); |
| 68 | return absl::OkStatus(); |
| 69 | } |
| 70 | |
| 71 | absl::Status CreateListStep::DoEvaluate(ExecutionFrame* frame, |
| 72 | Value* result) const { |
no test coverage detected