| 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 | { |
no test coverage detected