You are not logged in.
When I use JS_SetRuntimePrivate or JS_GetRuntimePrivate in SynSM, the app directly crash! And then show "Can not locate the program import point JS_SetRuntimePrivate..".
Offline
I had fixed this, see below:
function JS_GetRuntimePrivate(rt: PJSRuntime): pointer; cdecl; external SpiderMonkeyLib name '?JS_GetRuntimePrivate@@YAPAXPAUJSRuntime@@@Z';
procedure JS_SetRuntimePrivate(rt: PJSRuntime; data: pointer); cdecl; external SpiderMonkeyLib name '?JS_SetRuntimePrivate@@YAXPAUJSRuntime@@PAX@Z';
Offline
Really - we do not patch these functions to be visible from C (Delphi) code. Signatures you found is for C++. But my recommendation - do not use it (some external libs may also use runtime privat). Since we have one runtime & one context per thread you can store your runtime-related data in the threadvar (or using the way TSQLDBConnectionPropertiesThreadSafe.ThreadSafeConnection or TSMEngineManager.CurrentThreadEngine work)
Offline
+1 for threadvar
And you can sub-class your custom TSMEngine class and use TSMEngineManager.CurrentThreadEngine to retrieve the current running instance.
Or if you are using our mORMot interface-based services, you can use sicClientDriven kind of instance life-time.
Offline