MCPcopy Create free account
hub / github.com/Snapchat/Valdi / toFunction

Function toFunction

valdi/test/integration/JSIntegrationTestsUtils.cpp:7–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace ValdiTest {
6
7Ref<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
15Valdi::Result<Valdi::Value> callFunction(const Ref<ValueFunction>& function, const std::vector<Value>& params) {
16 return function->call(ValueFunctionFlagsCallSync, params.data(), params.size());

Callers 1

TEST_PFunction · 0.70

Calls 3

toStringMethod · 0.65
ExceptionClass · 0.50
getFunctionRefMethod · 0.45

Tested by

no test coverage detected