| 5 | namespace ValdiTest { |
| 6 | |
| 7 | Ref<ValueFunction> toFunction(const Value& value) { |
| 8 | if (value.getFunctionRef() == nullptr) { |
| 9 | throw Exception(STRING_FORMAT("Value {} is not a function", value.toString())); |
| 10 | } |
| 11 | |
| 12 | return value.getFunctionRef(); |
| 13 | } |
| 14 | |
| 15 | Valdi::Result<Valdi::Value> callFunction(const Ref<ValueFunction>& function, const std::vector<Value>& params) { |
| 16 | return function->call(ValueFunctionFlagsCallSync, params.data(), params.size()); |
no test coverage detected