You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,7 @@
68
68
<ItemGroupCondition="'$(TargetPlatformIdentifier)' == 'browser' and '$(FeatureWasmManagedThreads)' == 'true'">
Copy file name to clipboardExpand all lines: src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSProxyContext.cs
Environment.FailFast("TODO implement blocking ReleaseCSOwnedObjectSend to make sure the order of FreeJSVHandle is correct.");
487
+
Environment.FailFast($"TODO implement blocking ReleaseCSOwnedObjectSend to make sure the order of FreeJSVHandle is correct, ManagedThreadId: {Environment.CurrentManagedThreadId}. {Environment.NewLine}{Environment.StackTrace}");
487
488
}
488
489
489
490
// this is async message, we need to call this as the last thing
Copy file name to clipboardExpand all lines: src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,7 @@ public static unsafe JSSynchronizationContext InstallWebWorkerInterop(bool isMai
Copy file name to clipboardExpand all lines: src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Marshaling/JSMarshalerArgument.Task.cs
// this means that we are not in the return value of JSExport
396
+
// we are marshaling parameter of JSImport
397
+
returntrue;
398
+
}
399
+
400
+
if(ctx.IsCurrentThread())
401
+
{
402
+
// If the JS and Managed is running on the same thread we can use the args buffer,
403
+
// because the call is synchronous and the buffer will be processed.
404
+
// In that case the pre-allocated Promise would be discarded as necessary
405
+
// and the result will be marshaled by `try_marshal_sync_task_to_js`
406
+
returntrue;
407
+
}
408
+
409
+
// Otherwise this is JSExport return value and we can't use the args buffer, because the args buffer arrived in async message and nobody is reading after this.
410
+
// In such case the JS side already pre-created the Promise and we have to use it, to resolve it in separate call via `mono_wasm_resolve_or_reject_promise_post`
411
+
// there is JSVHandle in this arg
412
+
returnfalse;
413
+
}
414
+
#else
415
+
#pragma warning disable CA1822// Mark members as static
0 commit comments