[js] Add some utility functions to get the current JS runtime.

master
Fedor 2020-09-09 17:29:43 +03:00
parent a84aca97e2
commit f9bd1dc92c
2 changed files with 8 additions and 0 deletions

View File

@ -483,6 +483,11 @@ JS_DestroyContext(JSContext* cx)
DestroyContext(cx);
}
JS_PUBLIC_API(JSRuntime*)
JS_GetRuntime(JSContext* cx) {
return cx->runtime();
}
static JS_CurrentEmbedderTimeFunction currentEmbedderTimeFunction;
JS_PUBLIC_API(void)

View File

@ -995,6 +995,9 @@ JS_NewContext(uint32_t maxbytes,
extern JS_PUBLIC_API(void)
JS_DestroyContext(JSContext* cx);
extern JS_PUBLIC_API(JSRuntime*)
JS_GetRuntime(JSContext* cx);
typedef double (*JS_CurrentEmbedderTimeFunction)();
/**