summaryrefslogtreecommitdiff
path: root/gjs/jsapi-util.cpp
diff options
context:
space:
mode:
authorTim Lunn <tim@feathertop.org>2013-10-01 09:23:48 +1000
committerTim Lunn <tim@feathertop.org>2013-11-09 07:30:59 +1100
commita3241ac8520053dbf3185c8f171c7a6d81487b52 (patch)
treea7142bd5a49b2b7a8de11b682fc4b4c1f86946a9 /gjs/jsapi-util.cpp
parente82315c477e2a95e914555db575facfaa1893311 (diff)
downloadgjs-wip/js24.tar.gz
JS_SetVersion has been removed, JS Version is now set on the compartment instead of context.wip/js24
https://bugzilla.gnome.org/show_bug.cgi?id=711046
Diffstat (limited to 'gjs/jsapi-util.cpp')
-rw-r--r--gjs/jsapi-util.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 031e7f78..c4beb7e8 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -88,11 +88,18 @@ static JSClass global_class = {
* Returns: %TRUE on success, %FALSE otherwise
*/
gboolean
-gjs_init_context_standard (JSContext *context)
+gjs_init_context_standard (JSContext *context,
+ JSVersion js_version)
{
JSObject *global;
+ JS::CompartmentOptions options;
- global = JS_NewGlobalObject(context, &global_class, NULL);
+ gjs_debug(GJS_DEBUG_CONTEXT,
+ "Setting JavaScript version to %s",
+ JS_VersionToString(js_version));
+
+ options.setVersion(js_version);
+ global = JS_NewGlobalObject(context, &global_class, NULL, options);
if (global == NULL)
return FALSE;