From 1012dbe9e5b2d00f967b0523f94ac8cc7ed3118d Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 6 Aug 2020 18:27:32 +0000 Subject: [js] Add some utility functions to get the current JS runtime. --- js/src/jsapi.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/src/jsapi.cpp') diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 3e0c63811..77124355c 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) -- cgit v1.2.3