[gjs] Fix previous commit: function_name was actually used in the newer xulrunner case



commit c1ead5af5f9f18cdb93849363c199922dbc8b6a2
Author: Colin Walters <walters verbum org>
Date:   Wed May 4 12:38:09 2011 -0400

    Fix previous commit: function_name was actually used in the newer xulrunner case

 gjs/profiler.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gjs/profiler.c b/gjs/profiler.c
index 9b5096d..cd17276 100644
--- a/gjs/profiler.c
+++ b/gjs/profiler.c
@@ -156,11 +156,13 @@ gjs_profile_function_key_from_js(JSContext             *cx,
 #ifdef HAVE_JS_GETFUNCTIONNAME
     key->function_name = g_strdup(function != NULL ? JS_GetFunctionName(function) : "(unknown)");
 #else
-    function_name = JS_GetFunctionId(function);
-    if (function_name)
-        key->function_name = gjs_string_get_ascii(cx, STRING_TO_JSVAL(function_name));
-    else
-        key->function_name = g_strdup("(unknown)");
+    {
+        JSString *function_name = JS_GetFunctionId(function);
+        if (function_name)
+            key->function_name = gjs_string_get_ascii(cx, STRING_TO_JSVAL(function_name));
+        else
+            key->function_name = g_strdup("(unknown)");
+    }
 #endif
 
     g_assert(key->filename != NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]