MCPcopy Create free account
hub / github.com/Tracktion/choc / performCall

Method performCall

choc/javascript/choc_javascript_V8.h:234–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232 }
233
234 choc::value::Value performCall() override
235 {
236 choc::value::Value result;
237 auto functionObject = currentCallContext->localContext->Global()->Get (currentCallContext->localContext,
238 currentCallContext->functionName).ToLocalChecked();
239
240 if (functionObject->IsFunction())
241 {
242 auto function = v8::Local<v8::Function>::Cast (functionObject);
243
244 auto resultValue = function->Call (currentCallContext->localContext, v8::Null (isolate),
245 static_cast<int> (currentCallContext->functionArgs.size()),
246 currentCallContext->functionArgs.data());
247
248 if (! resultValue.IsEmpty())
249 result = v8ToChoc (currentCallContext->localContext, resultValue.ToLocalChecked());
250 }
251
252 currentCallContext.reset();
253 return result;
254 }
255
256 void registerFunction (const std::string& name, Context::NativeFunction fn) override
257 {

Callers 2

invokeMethod · 0.80
invokeWithArgListMethod · 0.80

Calls 3

sizeMethod · 0.45
dataMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected