Blame SOURCES/mozjs78.patch

d559a5
diff --git a/configure.ac b/configure.ac
d559a5
index eea70fc..c4569f1 100644
d559a5
--- a/configure.ac
d559a5
+++ b/configure.ac
d559a5
@@ -34,7 +34,7 @@ AC_PROG_LN_S
d559a5
 AC_SYS_LARGEFILE
d559a5
 AM_PROG_CC_C_O
d559a5
 AC_PROG_CXX
d559a5
-AX_CXX_COMPILE_STDCXX([14], [], [mandatory])
d559a5
+AX_CXX_COMPILE_STDCXX([17], [], [mandatory])
d559a5
 
d559a5
 # Taken from dbus
d559a5
 AC_ARG_ENABLE(ansi,             [  --enable-ansi           enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
d559a5
@@ -80,7 +80,7 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
d559a5
 AC_SUBST(GLIB_CFLAGS)
d559a5
 AC_SUBST(GLIB_LIBS)
d559a5
 
d559a5
-PKG_CHECK_MODULES(LIBJS, [mozjs-68])
d559a5
+PKG_CHECK_MODULES(LIBJS, [mozjs-78])
d559a5
 
d559a5
 AC_SUBST(LIBJS_CFLAGS)
d559a5
 AC_SUBST(LIBJS_CXXFLAGS)
d559a5
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
d559a5
index 25bd1f9..ca17108 100644
d559a5
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
d559a5
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
d559a5
@@ -49,6 +49,7 @@
d559a5
 #include <js/Realm.h>
d559a5
 #include <js/SourceText.h>
d559a5
 #include <js/Warnings.h>
d559a5
+#include <js/Array.h>
d559a5
 #include <jsapi.h>
d559a5
 
d559a5
 #include "initjs.h" /* init.js */
d559a5
@@ -367,7 +368,7 @@ load_scripts (PolkitBackendJsAuthority  *authority)
d559a5
 static void
d559a5
 reload_scripts (PolkitBackendJsAuthority *authority)
d559a5
 {
d559a5
-  JS::AutoValueArray<1> args(authority->priv->cx);
d559a5
+  JS::RootedValueArray<1> args(authority->priv->cx);
d559a5
   JS::RootedValue rval(authority->priv->cx);
d559a5
 
d559a5
   JS::RootedObject js_polkit(authority->priv->cx, authority->priv->js_polkit->get ());
d559a5
@@ -482,10 +483,6 @@ polkit_backend_js_authority_constructed (GObject *object)
d559a5
   if (!JS::InitSelfHostedCode (authority->priv->cx))
d559a5
     goto fail;
d559a5
 
d559a5
-  JS::ContextOptionsRef (authority->priv->cx)
d559a5
-      .setIon (TRUE)
d559a5
-      .setBaseline (TRUE)
d559a5
-      .setAsmJS (TRUE);
d559a5
   JS::SetWarningReporter(authority->priv->cx, report_error);
d559a5
   JS_SetContextPrivate (authority->priv->cx, authority);
d559a5
 
d559a5
@@ -720,7 +717,7 @@ set_property_strv (PolkitBackendJsAuthority  *authority,
d559a5
         elems[n].setNull ();
d559a5
     }
d559a5
 
d559a5
-  JS::RootedObject array_object(authority->priv->cx, JS_NewArrayObject (authority->priv->cx, elems));
d559a5
+  JS::RootedObject array_object(authority->priv->cx, JS::NewArrayObject (authority->priv->cx, elems));
d559a5
 
d559a5
   value_jsval = JS::ObjectValue (*array_object);
d559a5
   JS_SetProperty (authority->priv->cx, obj, name, value_jsval);
d559a5
@@ -1114,7 +1111,7 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
d559a5
 {
d559a5
   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority);
d559a5
   GList *ret = NULL;
d559a5
-  JS::AutoValueArray<2> args(authority->priv->cx);
d559a5
+  JS::RootedValueArray<2> args(authority->priv->cx);
d559a5
   JS::RootedValue rval(authority->priv->cx);
d559a5
   guint n;
d559a5
   GError *error = NULL;
d559a5
@@ -1218,7 +1215,7 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
d559a5
 {
d559a5
   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority);
d559a5
   PolkitImplicitAuthorization ret = implicit;
d559a5
-  JS::AutoValueArray<2> args(authority->priv->cx);
d559a5
+  JS::RootedValueArray<2> args(authority->priv->cx);
d559a5
   JS::RootedValue rval(authority->priv->cx);
d559a5
   GError *error = NULL;
d559a5
   JS::RootedString ret_jsstr (authority->priv->cx);
d559a5
@@ -1409,7 +1406,7 @@ js_polkit_spawn (JSContext  *cx,
d559a5
   JS::CallArgs args = JS::CallArgsFromVp (js_argc, vp);
d559a5
   array_object = &args[0].toObject();
d559a5
 
d559a5
-  if (!JS_GetArrayLength (cx, array_object, &array_len))
d559a5
+  if (!JS::GetArrayLength (cx, array_object, &array_len))
d559a5
     {
d559a5
       JS_ReportErrorUTF8 (cx, "Failed to get array length");
d559a5
       goto out;