TODO: merge this function with DoRunScriptFuncCantBlock
| 600 | |
| 601 | // TODO: merge this function with DoRunScriptFuncCantBlock |
| 602 | RunScFuncResult RunScriptFunctionNonBlocking(ScriptType sc_type, const ScriptFunctionRef &fn_ref, |
| 603 | size_t param_count, const RuntimeScriptValue *params) |
| 604 | { |
| 605 | auto *script = GetScriptInstance(sc_type, fn_ref.ModuleName); |
| 606 | |
| 607 | no_blocking_functions++; |
| 608 | const ScriptExecError result = scriptExecutor->Run(scriptThreadNonBlocking.get(), |
| 609 | script, fn_ref.FuncName, params, param_count); |
| 610 | |
| 611 | if ((result != kScExecErr_None) && (result != kScExecErr_FuncNotFound) && (result != kScExecErr_Aborted)) |
| 612 | { |
| 613 | quit_with_script_error(fn_ref.FuncName); |
| 614 | } |
| 615 | |
| 616 | // this might be nested, so don't disrupt blocked scripts |
| 617 | cc_clear_error(); |
| 618 | no_blocking_functions--; |
| 619 | |
| 620 | // Convert any instance exec error into RunScriptFunction result; |
| 621 | // NOTE: only kScExecErr_FuncNotFound and kScExecErr_Aborted can reach here |
| 622 | if (result == kScExecErr_FuncNotFound) |
| 623 | return kScFnRes_NotFound; |
| 624 | return kScFnRes_Done; |
| 625 | } |
| 626 | |
| 627 | void InitScriptExec() |
| 628 | { |
nothing calls this directly
no test coverage detected