From dbd710c12ec60a2256ab0ffc95f4a94d2b5c5ee4 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 22 Mar 2018 13:00:33 -0400 Subject: [PATCH] jsauthority: s/JSVAL_NULL/JS::NullValue()/ This commit does a global search and replace for JSVAL_NULL to JS::NullValue() Signed-off-by: Ray Strode https://bugs.freedesktop.org/show_bug.cgi?id=105865 --- src/polkitbackend/polkitbackendjsauthority.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp index 73251a8..eb22597 100644 --- a/src/polkitbackend/polkitbackendjsauthority.cpp +++ b/src/polkitbackend/polkitbackendjsauthority.cpp @@ -315,62 +315,62 @@ load_scripts (PolkitBackendJsAuthority *authority) filename); continue; } /* evaluate the script */ JS::Value rval; if (!execute_script_with_runaway_killer (authority, script, &rval)) { polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Error executing script %s", filename); continue; } //g_print ("Successfully loaded and evaluated script `%s'\n", filename); num_scripts++; } polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Finished loading, compiling and executing %d rules", num_scripts); g_list_free_full (files, g_free); } static void reload_scripts (PolkitBackendJsAuthority *authority) { - JS::Value argv[1] = {JSVAL_NULL}; - JS::Value rval = JSVAL_NULL; + JS::Value argv[1] = {JS::NullValue()}; + JS::Value rval = JS::NullValue(); JS_BeginRequest (authority->priv->cx); if (!JS_CallFunctionName(authority->priv->cx, authority->priv->js_polkit, "_deleteRules", 0, argv, &rval)) { polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Error deleting old rules, not loading new ones"); goto out; } polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Collecting garbage unconditionally..."); JS_GC (authority->priv->cx); load_scripts (authority); /* Let applications know we have new rules... */ g_signal_emit_by_name (authority, "changed"); out: JS_EndRequest (authority->priv->cx); } static void on_dir_monitor_changed (GFileMonitor *monitor, GFile *file, @@ -1057,62 +1057,62 @@ call_js_function_with_runaway_killer (PolkitBackendJsAuthority *authority, unsigned argc, JS::Value *argv, JS::Value *rval) { bool ret; runaway_killer_setup (authority); ret = JS_CallFunctionName(authority->priv->cx, authority->priv->js_polkit, function_name, argc, argv, rval); runaway_killer_teardown (authority); return ret; } /* ---------------------------------------------------------------------------------------------------- */ static GList * polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveAuthority *_authority, PolkitSubject *caller, PolkitSubject *subject, PolkitIdentity *user_for_subject, gboolean subject_is_local, gboolean subject_is_active, const gchar *action_id, PolkitDetails *details) { PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority); GList *ret = NULL; - JS::Value argv[2] = {JSVAL_NULL, JSVAL_NULL}; - JS::Value rval = JSVAL_NULL; + JS::Value argv[2] = {JS::NullValue(), JS::NullValue()}; + JS::Value rval = JS::NullValue(); guint n; GError *error = NULL; JSString *ret_jsstr; gchar *ret_str = NULL; gchar **ret_strs = NULL; JS_BeginRequest (authority->priv->cx); if (!action_and_details_to_jsval (authority, action_id, details, &argv[0], &error)) { polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Error converting action and details to JS object: %s", error->message); g_clear_error (&error); goto out; } if (!subject_to_jsval (authority, subject, user_for_subject, subject_is_local, subject_is_active, &argv[1], &error)) { polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Error converting subject to JS object: %s", error->message); g_clear_error (&error); goto out; @@ -1166,62 +1166,62 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA out: g_strfreev (ret_strs); g_free (ret_str); /* fallback to root password auth */ if (ret == NULL) ret = g_list_prepend (ret, polkit_unix_user_new (0)); JS_MaybeGC (authority->priv->cx); JS_EndRequest (authority->priv->cx); return ret; } /* ---------------------------------------------------------------------------------------------------- */ static PolkitImplicitAuthorization polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAuthority *_authority, PolkitSubject *caller, PolkitSubject *subject, PolkitIdentity *user_for_subject, gboolean subject_is_local, gboolean subject_is_active, const gchar *action_id, PolkitDetails *details, PolkitImplicitAuthorization implicit) { PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (_authority); PolkitImplicitAuthorization ret = implicit; - JS::Value argv[2] = {JSVAL_NULL, JSVAL_NULL}; - JS::Value rval = JSVAL_NULL; + JS::Value argv[2] = {JS::NullValue(), JS::NullValue()}; + JS::Value rval = JS::NullValue(); GError *error = NULL; JSString *ret_jsstr; const jschar *ret_utf16; gchar *ret_str = NULL; gboolean good = FALSE; JS_BeginRequest (authority->priv->cx); if (!action_and_details_to_jsval (authority, action_id, details, &argv[0], &error)) { polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Error converting action and details to JS object: %s", error->message); g_clear_error (&error); goto out; } if (!subject_to_jsval (authority, subject, user_for_subject, subject_is_local, subject_is_active, &argv[1], &error)) { polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority), "Error converting subject to JS object: %s", error->message); g_clear_error (&error); goto out; -- 2.16.2