[Xfce4-commits] <midori:master> Print error on console if script execution failed

Christian Dywan noreply at xfce.org
Sun Dec 27 17:08:05 CET 2009


Updating branch refs/heads/master
         to bd078ed1dd34040991ab08ce306091c7bf589e6c (commit)
       from b45fe5cca2f0fd71e63790f8151e79e62d8bf764 (commit)

commit bd078ed1dd34040991ab08ce306091c7bf589e6c
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Dec 27 16:54:34 2009 +0100

    Print error on console if script execution failed

 midori/sokoke.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/midori/sokoke.c b/midori/sokoke.c
index 643848c..d46de80 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -80,16 +80,23 @@ sokoke_js_script_eval (JSContextRef js_context,
     JSValueRef js_exception = NULL;
     JSValueRef js_value = JSEvaluateScript (js_context, js_script,
         JSContextGetGlobalObject (js_context), NULL, 0, &js_exception);
-    if (!js_value && exception)
+    JSStringRelease (js_script);
+
+    if (!js_value)
     {
         JSStringRef js_message = JSValueToStringCopy (js_context,
                                                       js_exception, NULL);
+        value = sokoke_js_string_utf8 (js_message);
         if (exception)
-            *exception = sokoke_js_string_utf8 (js_message);
+            *exception = value;
+        else
+        {
+            g_warning ("%s", value);
+            g_free (value);
+        }
         JSStringRelease (js_message);
-        js_value = JSValueMakeNull (js_context);
+        return NULL;
     }
-    JSStringRelease (js_script);
 
     js_value_string = JSValueToStringCopy (js_context, js_value, NULL);
     value = sokoke_js_string_utf8 (js_value_string);



More information about the Xfce4-commits mailing list