| 73 | VALDI_TRACE_META("Valdi.jsBridgeToNative", getFunctionName()); |
| 74 | |
| 75 | auto function = getFunction(callContext.getContext(), callContext.getExceptionTracker(), _isSingleCall); |
| 76 | CHECK_CALL_CONTEXT(callContext); |
| 77 | |
| 78 | ScopedNativeCallActivity nativeCallActivity(javaScriptRuntimeOf(getContext()), getFunctionName()); |
| 79 | |
| 80 | if (function->propagatesOwnerContextOnCall()) { |
| 81 | return callWithOwnerContextAsCurrent(function, callContext); |
| 82 | } else { |
| 83 | return doCall(function, &_functionName, callContext); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | JSFunctionWithUntypedValueFunction::JSFunctionWithUntypedValueFunction(Ref<ValueFunction>&& function, |
| 88 | const ReferenceInfo& referenceInfo) |
| 89 | : JSFunctionWithValueFunction(std::move(function), false, referenceInfo) {} |
| 90 | |
| 91 | JSValueRef JSFunctionWithUntypedValueFunction::doCall(const Ref<ValueFunction>& function, |
| 92 | const StringBox* precomputedFunctionIdentifier, |
| 93 | JSFunctionNativeCallContext& callContext) const { |
| 94 | auto referenceInfoBuilder = ReferenceInfoBuilder(getReferenceInfo()); |
| 95 | Valdi::SmallVector<Value, 8> outParameters; |
| 96 | { |
| 97 | VALDI_TRACE("Valdi.jsParametersToCpp"); |
| 98 | |
| 99 | for (size_t i = 0, size = callContext.getParameterSize(); i < size; i++) { |
| 100 | auto jsValue = callContext.getParameter(i); |
| 101 | |
| 102 | auto convertedParameterResult = jsValueToValue(callContext.getContext(), |
| 103 | jsValue, |
| 104 | referenceInfoBuilder.withParameter(i), |
| 105 | callContext.getExceptionTracker()); |
| 106 | if (!callContext.getExceptionTracker()) { |
| 107 | return callContext.getContext().newUndefined(); |
| 108 | } |
| 109 | |
| 110 | outParameters.emplace_back(std::move(convertedParameterResult)); |
nothing calls this directly
no test coverage detected