@@ -18,16 +18,16 @@ internal static unsafe partial class JavaScriptExports
1818 [ UnmanagedCallersOnly ( EntryPoint = "SystemInteropJS_ReleaseJSOwnedObjectByGCHandle" ) ]
1919 // The JS layer invokes this method when the JS wrapper for a JS owned object has been collected by the JS garbage collector
2020 // the marshaled signature is: void ReleaseJSOwnedObjectByGCHandle(GCHandle gcHandle)
21- public static void ReleaseJSOwnedObjectByGCHandle ( JSMarshalerArgument * arguments_buffer )
21+ public static void ReleaseJSOwnedObjectByGCHandle ( JSMarshalerArgument * argumentsBuffer )
2222 {
23- ref JSMarshalerArgument arg_exc = ref arguments_buffer [ 0 ] ; // initialized by caller in alloc_stack_frame()
24- ref JSMarshalerArgument arg_1 = ref arguments_buffer [ 2 ] ; // initialized and set by caller
23+ ref JSMarshalerArgument argException = ref argumentsBuffer [ 0 ] ; // initialized by caller in alloc_stack_frame()
24+ ref JSMarshalerArgument arg1 = ref argumentsBuffer [ 2 ] ; // initialized and set by caller
2525
2626 try
2727 {
2828 // when we arrive here, we are on the thread which owns the proxies or on IO thread
29- var ctx = arg_exc . ToManagedContext ;
30- ctx . ReleaseJSOwnedObjectByGCHandle ( arg_1 . slot . GCHandle ) ;
29+ var ctx = argException . ToManagedContext ;
30+ ctx . ReleaseJSOwnedObjectByGCHandle ( arg1 . slot . GCHandle ) ;
3131 }
3232 catch ( Exception ex )
3333 {
@@ -37,21 +37,21 @@ public static void ReleaseJSOwnedObjectByGCHandle(JSMarshalerArgument* arguments
3737
3838 [ UnmanagedCallersOnly ( EntryPoint = "SystemInteropJS_CallDelegate" ) ]
3939 // the marshaled signature is: TRes? CallDelegate<T1,T2,T3TRes>(GCHandle callback, T1? arg1, T2? arg2, T3? arg3)
40- public static void CallDelegate ( JSMarshalerArgument * arguments_buffer )
40+ public static void CallDelegate ( JSMarshalerArgument * argumentsBuffer )
4141 {
42- ref JSMarshalerArgument arg_exc = ref arguments_buffer [ 0 ] ; // initialized by JS caller in alloc_stack_frame()
43- // arg_res is initialized by JS caller
44- ref JSMarshalerArgument arg_1 = ref arguments_buffer [ 2 ] ; // initialized and set by JS caller
42+ ref JSMarshalerArgument argException = ref argumentsBuffer [ 0 ] ; // initialized by JS caller in alloc_stack_frame()
43+ // argResult is initialized by JS caller
44+ ref JSMarshalerArgument arg1 = ref argumentsBuffer [ 2 ] ; // initialized and set by JS caller
4545 // arg_2 set by JS caller when there are arguments
4646 // arg_3 set by JS caller when there are arguments
4747 // arg_4 set by JS caller when there are arguments
4848 try
4949 {
50- GCHandle callback_gc_handle = ( GCHandle ) arg_1 . slot . GCHandle ;
50+ GCHandle callback_gc_handle = ( GCHandle ) arg1 . slot . GCHandle ;
5151 if ( callback_gc_handle . Target is JSHostImplementation . ToManagedCallback callback )
5252 {
53- // arg_2, arg_3, arg_4, arg_res are processed by the callback
54- callback ( arguments_buffer ) ;
53+ // arg_2, arg_3, arg_4, argResult are processed by the callback
54+ callback ( argumentsBuffer ) ;
5555 }
5656 else
5757 {
@@ -60,33 +60,33 @@ public static void CallDelegate(JSMarshalerArgument* arguments_buffer)
6060 }
6161 catch ( Exception ex )
6262 {
63- arg_exc . ToJS ( ex ) ;
63+ argException . ToJS ( ex ) ;
6464 }
6565 }
6666
6767 [ UnmanagedCallersOnly ( EntryPoint = "SystemInteropJS_CompleteTask" ) ]
6868 // the marshaled signature is: void CompleteTask<T>(GCHandle holder, Exception? exceptionResult, T? result)
69- public static void CompleteTask ( JSMarshalerArgument * arguments_buffer )
69+ public static void CompleteTask ( JSMarshalerArgument * argumentsBuffer )
7070 {
71- ref JSMarshalerArgument arg_exc = ref arguments_buffer [ 0 ] ; // initialized by caller in alloc_stack_frame()
72- ref JSMarshalerArgument arg_res = ref arguments_buffer [ 1 ] ; // initialized by caller in alloc_stack_frame()
73- ref JSMarshalerArgument arg_1 = ref arguments_buffer [ 2 ] ; // initialized and set by caller
71+ ref JSMarshalerArgument argException = ref argumentsBuffer [ 0 ] ; // initialized by caller in alloc_stack_frame()
72+ ref JSMarshalerArgument argResult = ref argumentsBuffer [ 1 ] ; // initialized by caller in alloc_stack_frame()
73+ ref JSMarshalerArgument arg1 = ref argumentsBuffer [ 2 ] ; // initialized and set by caller
7474 // arg_2 set by caller when this is SetException call
7575 // arg_3 set by caller when this is SetResult call
7676
7777 try
7878 {
7979 // when we arrive here, we are on the thread which owns the proxies or on IO thread
80- var ctx = arg_exc . ToManagedContext ;
81- var holder = ctx . GetPromiseHolder ( arg_1 . slot . GCHandle ) ;
80+ var ctx = argException . ToManagedContext ;
81+ var holder = ctx . GetPromiseHolder ( arg1 . slot . GCHandle ) ;
8282 JSHostImplementation . ToManagedCallback callback ;
8383
8484 callback = holder . Callback ! ;
85- ctx . ReleasePromiseHolder ( arg_1 . slot . GCHandle ) ;
85+ ctx . ReleasePromiseHolder ( arg1 . slot . GCHandle ) ;
8686
8787 // arg_2, arg_3 are processed by the callback
8888 // JSProxyContext.PopOperation() is called by the callback
89- callback ! ( arguments_buffer ) ;
89+ callback ! ( argumentsBuffer ) ;
9090 }
9191 catch ( Exception ex )
9292 {
@@ -96,20 +96,20 @@ public static void CompleteTask(JSMarshalerArgument* arguments_buffer)
9696
9797 [ UnmanagedCallersOnly ( EntryPoint = "SystemInteropJS_GetManagedStackTrace" ) ]
9898 // the marshaled signature is: string GetManagedStackTrace(GCHandle exception)
99- public static void GetManagedStackTrace ( JSMarshalerArgument * arguments_buffer )
99+ public static void GetManagedStackTrace ( JSMarshalerArgument * argumentsBuffer )
100100 {
101- ref JSMarshalerArgument arg_exc = ref arguments_buffer [ 0 ] ; // initialized by caller in alloc_stack_frame()
102- ref JSMarshalerArgument arg_res = ref arguments_buffer [ 1 ] ; // used as return value
103- ref JSMarshalerArgument arg_1 = ref arguments_buffer [ 2 ] ; // initialized and set by caller
101+ ref JSMarshalerArgument argException = ref argumentsBuffer [ 0 ] ; // initialized by caller in alloc_stack_frame()
102+ ref JSMarshalerArgument argResult = ref argumentsBuffer [ 1 ] ; // used as return value
103+ ref JSMarshalerArgument arg1 = ref argumentsBuffer [ 2 ] ; // initialized and set by caller
104104 try
105105 {
106106 // when we arrive here, we are on the thread which owns the proxies
107- arg_exc . AssertCurrentThreadContext ( ) ;
107+ argException . AssertCurrentThreadContext ( ) ;
108108
109- GCHandle exception_gc_handle = ( GCHandle ) arg_1 . slot . GCHandle ;
109+ GCHandle exception_gc_handle = ( GCHandle ) arg1 . slot . GCHandle ;
110110 if ( exception_gc_handle . Target is Exception exception )
111111 {
112- arg_res . ToJS ( exception . StackTrace ) ;
112+ argResult . ToJS ( exception . StackTrace ) ;
113113 }
114114 else
115115 {
@@ -118,37 +118,38 @@ public static void GetManagedStackTrace(JSMarshalerArgument* arguments_buffer)
118118 }
119119 catch ( Exception ex )
120120 {
121- arg_exc . ToJS ( ex ) ;
121+ argException . ToJS ( ex ) ;
122122 }
123123 }
124124
125125 [ UnmanagedCallersOnly ( EntryPoint = "SystemInteropJS_BindAssemblyExports" ) ]
126126 // the marshaled signature is: Task BindAssemblyExports(string assemblyName)
127- public static void BindAssemblyExports ( JSMarshalerArgument * arguments_buffer )
127+ public static void BindAssemblyExports ( JSMarshalerArgument * argumentsBuffer )
128128 {
129- ref JSMarshalerArgument arg_exc = ref arguments_buffer [ 0 ] ; // initialized by caller in alloc_stack_frame()
130- ref JSMarshalerArgument arg_res = ref arguments_buffer [ 1 ] ; // used as return value
131- ref JSMarshalerArgument arg_1 = ref arguments_buffer [ 2 ] ; // initialized and set by caller
129+ ref JSMarshalerArgument argException = ref argumentsBuffer [ 0 ] ; // initialized by caller in alloc_stack_frame()
130+ ref JSMarshalerArgument argResult = ref argumentsBuffer [ 1 ] ; // used as return value
131+ ref JSMarshalerArgument arg1 = ref argumentsBuffer [ 2 ] ; // initialized and set by caller
132132 try
133133 {
134134 string ? assemblyName ;
135135 // when we arrive here, we are on the thread which owns the proxies
136- arg_exc . AssertCurrentThreadContext ( ) ;
137- arg_1 . ToManaged ( out assemblyName ) ;
136+ argException . AssertCurrentThreadContext ( ) ;
137+ arg1 . ToManaged ( out assemblyName ) ;
138138
139139 var result = JSHostImplementation . BindAssemblyExports ( assemblyName ) ;
140140
141- arg_res . ToJS ( result ) ;
141+ argResult . ToJS ( result ) ;
142142 }
143143 catch ( Exception ex )
144144 {
145145 Environment . FailFast ( $ "BindAssemblyExports: Unexpected synchronous failure (ManagedThreadId { Environment . CurrentManagedThreadId } ): " + ex ) ;
146146 }
147147 }
148148
149+ #pragma warning disable IDE0060
149150 [ UnmanagedCallersOnly ( EntryPoint = "SystemInteropJS_InvokeJSExport" ) ]
150151 // the marshaled signature is: Task BindAssemblyExports(string assemblyName)
151- public static void InvokeJSExport ( JSMarshalerArgument * arguments_buffer )
152+ public static void InvokeJSExport ( IntPtr methodHandle , JSMarshalerArgument * argumentsBuffer )
152153 {
153154 }
154155 }
0 commit comments