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
If any C# object is passed to JSImport, JavaScript side of the code will register it in FinalizationRegistry. This way C# side can get notification, when object is no longer used by JS side.
This logic doesn't seem to work with DotnetJS in LLVM. After a while app will output error in the console:
dotnet.runtime.js:3
Uncaught
Error: Missing wasm export '_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle' (for System.Runtime.InteropServices.JavaScript.JavaScriptExports.ReleaseJSOwnedObjectByGCHandle)
at dotnet.runtime.js:3:23922
at Zt (dotnet.runtime.js:3:23460)
at dotnet.runtime.js:3:34991
at vr (dotnet.runtime.js:3:35059)
at Tr (dotnet.runtime.js:3:35231)
at FinalizationRegistry.cleanupSome (<anonymous>)
Minimal repro:
publicstaticasyncTaskMain(){while(true){// Callback is expected to be hold in memory, until JS FinalizationRegistry notifies it's no longer used by JS code.SetTimeout(()=>{Console.WriteLine("From callback: "+DateTime.Now);},1000);awaitTask.Delay(1000);}}[JSImport("globalThis.setTimeout")]publicstaticpartialintSetTimeout([JSMarshalAs<JSType.Function>]Actioncallback,intintervalMs);
Run it and wait, resizing window also helps to trigger JS FinalizationRegistry.cleanupSome.
Or run minimal repro: naot-llvm-demo-finalizer.zip
The text was updated successfully, but these errors were encountered:
If any C# object is passed to JSImport, JavaScript side of the code will register it in FinalizationRegistry. This way C# side can get notification, when object is no longer used by JS side.
This logic doesn't seem to work with DotnetJS in LLVM. After a while app will output error in the console:
Minimal repro:
Run it and wait, resizing window also helps to trigger JS FinalizationRegistry.cleanupSome.
Or run minimal repro:
naot-llvm-demo-finalizer.zip
The text was updated successfully, but these errors were encountered: