Пример #1
0
        [MethodImplAttribute(MethodImplOptions.NoInlining)] // https://github.com/dotnet/runtime/issues/71425
        public static void MarshalPromise(Span <JSMarshalerArgument> arguments)
        {
            fixed(JSMarshalerArgument *ptr = arguments)
            {
                Interop.Runtime.MarshalPromise(ptr);
                ref JSMarshalerArgument exceptionArg = ref arguments[0];

                if (exceptionArg.slot.Type != MarshalerType.None)
                {
                    JSHostImplementation.ThrowException(ref exceptionArg);
                }
            }
Пример #2
0
        internal static unsafe void InvokeJSImpl(JSObject jsFunction, Span <JSMarshalerArgument> arguments)
        {
            IntPtr functionJSHandle = jsFunction.JSHandle;

            fixed(JSMarshalerArgument *ptr = arguments)
            {
                Interop.Runtime.InvokeJSFunction(functionJSHandle, ptr);
                ref JSMarshalerArgument exceptionArg = ref arguments[0];

                if (exceptionArg.slot.Type != MarshalerType.None)
                {
                    JSHostImplementation.ThrowException(ref exceptionArg);
                }
            }