@@ -75,7 +75,7 @@ public static void DumpAotProfileData (ref byte buf, int len, string extraArg)
75
75
Interop . Runtime . DumpAotProfileData ( ref buf , len , extraArg ) ;
76
76
}
77
77
78
- private static int BindJSObject ( int jsId , bool ownsHandle , int mappedType )
78
+ public static int BindJSObject ( int jsId , bool ownsHandle , int mappedType )
79
79
{
80
80
WeakReference ? reference ;
81
81
lock ( _boundObjects )
@@ -99,7 +99,7 @@ private static int BindJSObject(int jsId, bool ownsHandle, int mappedType)
99
99
return reference . Target is JSObject target ? target . Int32Handle : 0 ;
100
100
}
101
101
102
- private static int BindCoreCLRObject ( int jsId , int gcHandle )
102
+ public static int BindCoreCLRObject ( int jsId , int gcHandle )
103
103
{
104
104
GCHandle h = ( GCHandle ) ( IntPtr ) gcHandle ;
105
105
JSObject ? obj ;
@@ -157,7 +157,7 @@ internal static bool ReleaseJSObject(JSObject objToRelease)
157
157
return true ;
158
158
}
159
159
160
- private static void UnBindRawJSObjectAndFree ( int gcHandle )
160
+ public static void UnBindRawJSObjectAndFree ( int gcHandle )
161
161
{
162
162
GCHandle h = ( GCHandle ) ( IntPtr ) gcHandle ;
163
163
JSObject ? obj = h . Target as JSObject ;
@@ -171,27 +171,27 @@ private static void UnBindRawJSObjectAndFree(int gcHandle)
171
171
}
172
172
}
173
173
174
- private static object CreateTaskSource ( int jsId )
174
+ public static object CreateTaskSource ( int jsId )
175
175
{
176
176
return new TaskCompletionSource < object > ( ) ;
177
177
}
178
178
179
- private static void SetTaskSourceResult ( TaskCompletionSource < object > tcs , object result )
179
+ public static void SetTaskSourceResult ( TaskCompletionSource < object > tcs , object result )
180
180
{
181
181
tcs . SetResult ( result ) ;
182
182
}
183
183
184
- private static void SetTaskSourceFailure ( TaskCompletionSource < object > tcs , string reason )
184
+ public static void SetTaskSourceFailure ( TaskCompletionSource < object > tcs , string reason )
185
185
{
186
186
tcs . SetException ( new JSException ( reason ) ) ;
187
187
}
188
188
189
- private static int GetTaskAndBind ( TaskCompletionSource < object > tcs , int jsId )
189
+ public static int GetTaskAndBind ( TaskCompletionSource < object > tcs , int jsId )
190
190
{
191
191
return BindExistingObject ( tcs . Task , jsId ) ;
192
192
}
193
193
194
- private static int BindExistingObject ( object rawObj , int jsId )
194
+ public static int BindExistingObject ( object rawObj , int jsId )
195
195
{
196
196
JSObject ? jsObject ;
197
197
if ( rawObj is Delegate dele )
@@ -219,7 +219,7 @@ private static int BindExistingObject(object rawObj, int jsId)
219
219
return jsObject . Int32Handle ;
220
220
}
221
221
222
- private static int GetJSObjectId ( object rawObj )
222
+ public static int GetJSObjectId ( object rawObj )
223
223
{
224
224
JSObject ? jsObject ;
225
225
if ( rawObj is Delegate dele )
@@ -239,15 +239,15 @@ private static int GetJSObjectId(object rawObj)
239
239
return jsObject ? . JSHandle ?? - 1 ;
240
240
}
241
241
242
- private static object ? GetDotNetObject ( int gcHandle )
242
+ public static object ? GetDotNetObject ( int gcHandle )
243
243
{
244
244
GCHandle h = ( GCHandle ) ( IntPtr ) gcHandle ;
245
245
246
246
return h . Target is JSObject js ?
247
247
js . GetWrappedObject ( ) ?? h . Target : h . Target ;
248
248
}
249
249
250
- private static bool IsSimpleArray ( object a )
250
+ public static bool IsSimpleArray ( object a )
251
251
{
252
252
return a is System . Array arr && arr . Rank == 1 && arr . GetLowerBound ( 0 ) == 0 ;
253
253
}
@@ -262,7 +262,7 @@ private struct IntPtrAndHandle
262
262
internal RuntimeMethodHandle handle ;
263
263
}
264
264
265
- private static string GetCallSignature ( IntPtr methodHandle )
265
+ public static string GetCallSignature ( IntPtr methodHandle )
266
266
{
267
267
IntPtrAndHandle tmp = default ( IntPtrAndHandle ) ;
268
268
tmp . ptr = methodHandle ;
@@ -338,7 +338,7 @@ private static string GetCallSignature(IntPtr methodHandle)
338
338
return new string ( res ) ;
339
339
}
340
340
341
- private static void SetupJSContinuation ( Task task , JSObject continuationObj )
341
+ public static void SetupJSContinuation ( Task task , JSObject continuationObj )
342
342
{
343
343
if ( task . IsCompleted )
344
344
Complete ( ) ;
@@ -405,12 +405,12 @@ void Complete()
405
405
return null ;
406
406
}
407
407
408
- private static string ObjectToString ( object o )
408
+ public static string ObjectToString ( object o )
409
409
{
410
410
return o . ToString ( ) ?? string . Empty ;
411
411
}
412
412
413
- private static double GetDateValue ( object dtv )
413
+ public static double GetDateValue ( object dtv )
414
414
{
415
415
if ( dtv == null )
416
416
throw new ArgumentNullException ( nameof ( dtv ) ) ;
@@ -423,18 +423,18 @@ private static double GetDateValue(object dtv)
423
423
return new DateTimeOffset ( dt ) . ToUnixTimeMilliseconds ( ) ;
424
424
}
425
425
426
- private static DateTime CreateDateTime ( double ticks )
426
+ public static DateTime CreateDateTime ( double ticks )
427
427
{
428
428
DateTimeOffset unixTime = DateTimeOffset . FromUnixTimeMilliseconds ( ( long ) ticks ) ;
429
429
return unixTime . DateTime ;
430
430
}
431
431
432
- private static Uri CreateUri ( string uri )
432
+ public static Uri CreateUri ( string uri )
433
433
{
434
434
return new Uri ( uri ) ;
435
435
}
436
436
437
- private static bool SafeHandleAddRef ( SafeHandle safeHandle )
437
+ public static bool SafeHandleAddRef ( SafeHandle safeHandle )
438
438
{
439
439
bool _addRefSucceeded = false ;
440
440
#if DEBUG_HANDLE
@@ -466,7 +466,7 @@ private static bool SafeHandleAddRef(SafeHandle safeHandle)
466
466
return _addRefSucceeded ;
467
467
}
468
468
469
- private static void SafeHandleRelease ( SafeHandle safeHandle )
469
+ public static void SafeHandleRelease ( SafeHandle safeHandle )
470
470
{
471
471
safeHandle . DangerousRelease ( ) ;
472
472
#if DEBUG_HANDLE
@@ -479,7 +479,7 @@ private static void SafeHandleRelease(SafeHandle safeHandle)
479
479
#endif
480
480
}
481
481
482
- private static void SafeHandleReleaseByHandle ( int jsId )
482
+ public static void SafeHandleReleaseByHandle ( int jsId )
483
483
{
484
484
#if DEBUG_HANDLE
485
485
Debug . WriteLine ( $ "SafeHandleReleaseByHandle: { jsId } ") ;
0 commit comments