| 11 | ValueFunctionWithJavaFunction::~ValueFunctionWithJavaFunction() = default; |
| 12 | |
| 13 | Valdi::Value ValueFunctionWithJavaFunction::operator()(const Valdi::ValueFunctionCallContext& callContext) noexcept { |
| 14 | Valdi::Marshaller marshaller(callContext.getExceptionTracker()); |
| 15 | for (size_t i = 0; i < callContext.getParametersSize(); i++) { |
| 16 | marshaller.push(callContext.getParameters()[i]); |
| 17 | } |
| 18 | |
| 19 | ValdiFunctionType functionObject(JavaEnv(), get()); |
| 20 | |
| 21 | VALDI_TRACE("Valdi.callJavaFunction"); |
| 22 | JavaEnv::getCache().getValdiFunctionNativePerformFromNativeMethod().call( |
| 23 | JavaEnv::getCache().getValdiFunctionNativeClass().getClass(), |
| 24 | functionObject, |
| 25 | reinterpret_cast<int64_t>(&marshaller)); |
| 26 | |
| 27 | if (!callContext.getExceptionTracker()) { |
| 28 | return Valdi::Value::undefined(); |
| 29 | } else { |
| 30 | return marshaller.getOrUndefined(-1); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | std::string_view ValueFunctionWithJavaFunction::getFunctionType() const { |
| 35 | return "Java"; |
nothing calls this directly
no test coverage detected