The callback is invoked on the current runtime execution thread, therefore execution is blocked until the callback completes.
The callback can be used by hosts to prepare for garbage collection. For example, by releasing unnecessary references on Chakra objects.
public void SetBeforeCollectCallback(IntPtr callbackState, JavaScriptBeforeCollectCallback beforeCollectCallback) { Native.ThrowIfError(Native.JsSetRuntimeBeforeCollectCallback(this, callbackState, beforeCollectCallback)); }