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

Method doCall

valdi_core/src/valdi_core/cpp/Utils/BridgeObject.cpp:49–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47VALDI_CLASS_IMPL(BridgeObject)
48
49Value BridgeObject::doCall(const StringBox& method,
50 const Value* parameters,
51 size_t parametersSize,
52 ValueFunctionFlags flags) {
53 auto function = _object.getMapValue(method);
54 if (!function.isFunction()) {
55 _bridgeContext->onError(Error(STRING_FORMAT("Cannot call '{}' since its not a function", method)));
56 return Value::undefined();
57 }
58
59 return (*function.getFunction())(ValueFunctionCallContext(flags, parameters, parametersSize, *_bridgeContext));
60}
61
62const Ref<BridgeContext>& BridgeObject::getBridgeContext() const {
63 return _bridgeContext;

Callers

nothing calls this directly

Calls 6

getMapValueMethod · 0.80
ErrorClass · 0.70
onErrorMethod · 0.65
getFunctionMethod · 0.65
isFunctionMethod · 0.45

Tested by

no test coverage detected