diff options
author | Moonchild <moonchild@palemoon.org> | 2020-08-06 18:27:32 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-08-06 18:28:54 +0000 |
commit | c349f04f9501c5035667f8064782d06e298cb52a (patch) | |
tree | 2897b8c4fa5b1dfe4de1ad4f61a173532b2afa96 /js/src | |
parent | 1c342a57ee39df04da71d62b80e245810c32fb42 (diff) | |
download | uxp-c349f04f9501c5035667f8064782d06e298cb52a.tar.gz |
[js] Add some utility functions to get the current JS runtime.
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/jsapi.cpp | 5 | ||||
-rw-r--r-- | js/src/jsapi.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 3e0c63811c..77124355cf 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -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) diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 76781cf065..c6299e3f57 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -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)(); /** |