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

Function callFunctionSync

valdi/test/integration/Runtime_tests.cpp:241–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239 return exceptionTracker.toResult(std::move(valueFunction));
240}
241
242static Result<Value> callFunctionSync(
243 RuntimeWrapper& wrapper,
244 const std::shared_ptr<snap::valdi_core::JSRuntimeNativeObjectsManager>& nativeObjectsManager,
245 std::string_view moduleName,
246 std::string_view functionName,
247 std::vector<Value> params) {
248 auto function =
249 getJsModulePropertyAsUntypedFunction(wrapper.runtime, nativeObjectsManager, moduleName, functionName);
250 if (!function) {
251 return function.moveError();
252 }
253
254 return function.value()->call(ValueFunctionFlagsCallSync, params.data(), params.size());
255}
256
257static Result<Value> callFunctionSync(RuntimeWrapper& wrapper,

Callers 2

TEST_PFunction · 0.85
TEST_PMethod · 0.85

Calls 5

callMethod · 0.65
valueMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected