| 375 | } |
| 376 | |
| 377 | bool ASContext::CallScriptFunction(ASFunctionHandle handle, const ASArglist *args, ASArg *return_val) { |
| 378 | if (handle >= 0) { |
| 379 | asIScriptFunction *func = expected_functions[handle].func_ptr; |
| 380 | const std::string &definition = expected_functions[handle].definition; |
| 381 | if (func) { |
| 382 | profiler.CallScriptFunction(definition.c_str()); |
| 383 | run(func, args, return_val); |
| 384 | profiler.LeaveScriptFunction(); |
| 385 | return true; |
| 386 | } else { |
| 387 | if (expected_functions[handle].unloaded) { |
| 388 | LOGE << "Expected function " << expected_functions[handle].definition << " was not pre-loaded." << std::endl; |
| 389 | } |
| 390 | return false; |
| 391 | } |
| 392 | } else { |
| 393 | LOGF << "Invalid handle" << std::endl; |
| 394 | return false; |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | bool ASContext::HasFunction(const std::string &function_definition) { |
| 399 | asIScriptFunction *func = module.GetFunctionID(function_definition); |
no test coverage detected