mozilla-spidermonkey / spidermonkey-embedding-examples

Documentation and examples for embedding the SpiderMonkey JavaScript / WebAssembly engine in their applications.
Other
197 stars 34 forks source link

WeakRef and FinalizationRegistry example #75

Closed ptomato closed 3 months ago

ptomato commented 1 year ago

An embedding must call JS::ClearKeptObjects() and set a callback for the HostCleanupFinalizationRegistry operation in order for WeakRef and FinalizationRegistry to work properly. This example illustrates the minimum that an embedding should do.

ptomato commented 9 months ago

@arai-a Thanks for the review, I think your suggestions really improved the example. Could you take another look at the updated version?

ptomato commented 8 months ago

@arai-a I think your feedback made the comments clearer, so thanks! Would you like to take another look?