| 579 | |
| 580 | if (func->valid(args.size())) |
| 581 | { |
| 582 | QiVar result = func->exec(args, this); |
| 583 | stack.push_back(result); |
| 584 | } |
| 585 | else throw ScriptException(ScriptException::error_invalid_functions_parameter, {}, token.value); |
| 586 | } |
| 587 | else |
| 588 | { |
| 589 | std::shared_ptr<const QiCustomFunc> definition; |
| 590 | { |
| 591 | std::lock_guard<std::mutex> lock(customFunctionsMutex); |
| 592 | auto customIt = customFunctions.find(token.value); |
| 593 | if (customIt != customFunctions.end()) definition = customIt->second; |