Blame SOURCES/polkit-0.115-move-to-mozjs60.patch

21b991
diff --git a/configure.ac b/configure.ac
21b991
index 5c37e481147466fd5a3a0a6b814f20fd2fe6bce8..5cedb4eca980f050fb5855ab577e93100adf8fec 100644
21b991
--- a/configure.ac
21b991
+++ b/configure.ac
21b991
@@ -79,7 +79,7 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
21b991
 AC_SUBST(GLIB_CFLAGS)
21b991
 AC_SUBST(GLIB_LIBS)
21b991
 
21b991
-PKG_CHECK_MODULES(LIBJS, [mozjs-52])
21b991
+PKG_CHECK_MODULES(LIBJS, [mozjs-60])
21b991
 
21b991
 AC_SUBST(LIBJS_CFLAGS)
21b991
 AC_SUBST(LIBJS_CXXFLAGS)
21b991
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
21b991
index 76027149d4dfdc54064be48a3aeafeec8326a67b..984a0f0e579d51c09117f4e495b0c3fdc46fe61b 100644
21b991
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
21b991
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
21b991
@@ -150,18 +150,17 @@ G_DEFINE_TYPE (PolkitBackendJsAuthority, polkit_backend_js_authority, POLKIT_BAC
21b991
 /* ---------------------------------------------------------------------------------------------------- */
21b991
 
21b991
 static const struct JSClassOps js_global_class_ops = {
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL
21b991
+  nullptr,  // addProperty
21b991
+  nullptr,  // deleteProperty
21b991
+  nullptr,  // enumerate
21b991
+  nullptr,  // newEnumerate
21b991
+  nullptr,  // resolve
21b991
+  nullptr,  // mayResolve
21b991
+  nullptr,  // finalize
21b991
+  nullptr,  // call
21b991
+  nullptr,  // hasInstance
21b991
+  nullptr,  // construct
21b991
+  JS_GlobalObjectTraceHook
21b991
 };
21b991
 
21b991
 static JSClass js_global_class = {
21b991
@@ -172,18 +171,17 @@ static JSClass js_global_class = {
21b991
 
21b991
 /* ---------------------------------------------------------------------------------------------------- */
21b991
 static const struct JSClassOps js_polkit_class_ops = {
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL,
21b991
-  NULL
21b991
+  nullptr,  // addProperty
21b991
+  nullptr,  // deleteProperty
21b991
+  nullptr,  // enumerate
21b991
+  nullptr,  // newEnumerate
21b991
+  nullptr,  // resolve
21b991
+  nullptr,  // mayResolve
21b991
+  nullptr,  // finalize
21b991
+  nullptr,  // call
21b991
+  nullptr,  // hasInstance
21b991
+  nullptr,  // construct
21b991
+  nullptr   // trace
21b991
 };
21b991
 
21b991
 static JSClass js_polkit_class = {
21b991
@@ -469,19 +467,18 @@ polkit_backend_js_authority_constructed (GObject *object)
21b991
 
21b991
   {
21b991
     JS::CompartmentOptions compart_opts;
21b991
-    compart_opts.behaviors().setVersion(JSVERSION_LATEST);
21b991
+
21b991
     JS::RootedObject global(authority->priv->cx);
21b991
 
21b991
     authority->priv->js_global = new JS::Heap<JSObject*> (JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL, JS::FireOnNewGlobalHook, compart_opts));
21b991
 
21b991
     global = authority->priv->js_global->get ();
21b991
-
21b991
-    if (global == NULL)
21b991
+    if (!global)
21b991
       goto fail;
21b991
 
21b991
     authority->priv->ac = new JSAutoCompartment(authority->priv->cx,  global);
21b991
 
21b991
-    if (authority->priv->ac == NULL)
21b991
+    if (!authority->priv->ac)
21b991
       goto fail;
21b991
 
21b991
     if (!JS_InitStandardClasses (authority->priv->cx, global))
21b991
@@ -493,7 +490,7 @@ polkit_backend_js_authority_constructed (GObject *object)
21b991
 
21b991
     polkit = authority->priv->js_polkit->get ();
21b991
 
21b991
-    if (polkit == NULL)
21b991
+    if (!polkit)
21b991
       goto fail;
21b991
 
21b991
     if (!JS_DefineProperty(authority->priv->cx, global, "polkit", polkit, JSPROP_ENUMERATE))
21b991
@@ -504,7 +501,7 @@ polkit_backend_js_authority_constructed (GObject *object)
21b991
                              js_polkit_functions))
21b991
       goto fail;
21b991
 
21b991
-    JS::CompileOptions options(authority->priv->cx, JSVERSION_UNKNOWN);
21b991
+    JS::CompileOptions options(authority->priv->cx);
21b991
     JS::RootedValue rval(authority->priv->cx);
21b991
     if (!JS::Evaluate (authority->priv->cx,
21b991
                        options,
21b991
@@ -684,7 +681,9 @@ set_property_strv (PolkitBackendJsAuthority  *authority,
21b991
   JS::AutoValueVector elems(authority->priv->cx);
21b991
   guint n;
21b991
 
21b991
-  elems.resize(value->len);
21b991
+  if (!elems.resize(value->len))
21b991
+    g_error ("Unable to resize vector");
21b991
+
21b991
   for (n = 0; n < value->len; n++)
21b991
     {
21b991
       const char *c_string = (const char *) g_ptr_array_index(value, n);
21b991
@@ -741,7 +740,7 @@ subject_to_jsval (PolkitBackendJsAuthority  *authority,
21b991
                   GError                   **error)
21b991
 {
21b991
   gboolean ret = FALSE;
21b991
-  JS::CompileOptions options(authority->priv->cx, JSVERSION_UNKNOWN);
21b991
+  JS::CompileOptions options(authority->priv->cx);
21b991
   const char *src;
21b991
   JS::RootedObject obj(authority->priv->cx);
21b991
   pid_t pid;
21b991
@@ -868,7 +867,7 @@ action_and_details_to_jsval (PolkitBackendJsAuthority  *authority,
21b991
                              GError                   **error)
21b991
 {
21b991
   gboolean ret = FALSE;
21b991
-  JS::CompileOptions options(authority->priv->cx, JSVERSION_UNKNOWN);
21b991
+  JS::CompileOptions options(authority->priv->cx);
21b991
   const char *src;
21b991
   JS::RootedObject obj(authority->priv->cx);
21b991
   gchar **keys;
21b991