aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2011-05-03 00:55:40 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-05-03 11:52:18 +0200
commit539ef2ff466333cb9d8421eba3eeca3d492da846 (patch)
tree2d6e624781fc68d68f96f90f6eba0ff146b78401 /plugins
parent68da48ebe86f5a9118884cd31e5309530c4fddbd (diff)
downloadpacrunner-539ef2ff466333cb9d8421eba3eeca3d492da846.tar.gz
mozjs: Use JS_NewCompartmentAndGlobalObject() with newer mozjs library
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mozjs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mozjs.c b/plugins/mozjs.c
index d4730f4..9f18d33 100644
--- a/plugins/mozjs.c
+++ b/plugins/mozjs.c
@@ -162,7 +162,11 @@ static void create_object(void)
jsctx = JS_NewContext(jsrun, 8 * 1024);
+#if JS_VERSION >= 185
+ jsobj = JS_NewCompartmentAndGlobalObject(jsctx, &jscls, NULL);
+#else
jsobj = JS_NewObject(jsctx, &jscls, NULL, NULL);
+#endif
if (!JS_InitStandardClasses(jsctx, jsobj))
pacrunner_error("Failed to init JS standard classes");