diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 6f66f4c8f..69a3ba2ac 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 56c54dcd2..5cdfd958e 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)(); /**