| 823 | return proxy; |
| 824 | } |
| 825 | |
| 826 | JSValueRef JavaScriptRuntime::runtimePerformSyncWithMainThread(JSFunctionNativeCallContext& callContext) { |
| 827 | auto wrappedJsFunctionResult = callContext.getParameterAsValue(0); |
| 828 | CHECK_CALL_CONTEXT(callContext); |
| 829 | auto wrappedJsFunction = wrappedJsFunctionResult.getFunctionRef(); |
| 830 | if (wrappedJsFunction == nullptr) { |
| 831 | return callContext.throwError(Error("Expecting function")); |
| 832 | } |
| 833 | |
| 834 | dispatchOnMainThread([wrappedJsFunction] { |
| 835 | // This wrapped function will automatically manage the main thread batch. |
| 836 | (*wrappedJsFunction)(Valdi::ValueFunctionFlagsCallSync, {}); |
| 837 | }); |
| 838 | |
| 839 | return callContext.getContext().newUndefined(); |
| 840 | } |
no outgoing calls
no test coverage detected