[gjs/wip/ptomato/mozjs38: 2/5] js: Discontinue JS_GetTypeName()



commit 224d8e1c7bf231ea6c6fd14df88f32221240db74
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Jan 7 21:57:46 2017 -0800

    js: Discontinue JS_GetTypeName()
    
    JS_GetTypeName() is going away in SpiderMonkey 38. Luckily, we have a
    very similar function in GJS already, gjs_get_type_name(), so we'll use
    that instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776966

 gi/arg.cpp      |   10 +++-------
 gi/function.cpp |    8 +++-----
 2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 6b24c37..8f6ba96 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1229,8 +1229,7 @@ throw_invalid_argument(JSContext      *context,
 
     gjs_throw(context, "Expected type %s for %s but got type '%s'",
               type_tag_to_human_string(arginfo),
-              display_name,
-              JS_GetTypeName(context, JS_TypeOfValue(context, value)));
+              display_name, gjs_get_type_name(value));
     g_free(display_name);
 }
 
@@ -1735,9 +1734,7 @@ gjs_value_to_g_argument(JSContext      *context,
                 if (arg->v_pointer == NULL) {
                     gjs_debug(GJS_DEBUG_GFUNCTION,
                               "conversion of JSObject %p type %s to type %s failed",
-                              &value.toObject(),
-                              JS_GetTypeName(context,
-                                             JS_TypeOfValue(context, value)),
+                              &value.toObject(), gjs_get_type_name(value),
                               g_base_info_get_name ((GIBaseInfo *)interface_info));
 
                     /* gjs_throw should have been called already */
@@ -1777,8 +1774,7 @@ gjs_value_to_g_argument(JSContext      *context,
             } else {
                 gjs_debug(GJS_DEBUG_GFUNCTION,
                           "JSObject type '%s' is neither null nor an object",
-                          JS_GetTypeName(context,
-                                         JS_TypeOfValue(context, value)));
+                          gjs_get_type_name(value));
                 wrong = true;
                 report_type_mismatch = true;
             }
diff --git a/gi/function.cpp b/gi/function.cpp
index 70ae3df..76aa885 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -859,8 +859,7 @@ gjs_invoke_c_function(JSContext                              *context,
                                   g_base_info_get_namespace( (GIBaseInfo*) function->info),
                                   g_base_info_get_name( (GIBaseInfo*) function->info),
                                   g_base_info_get_name( (GIBaseInfo*) &arg_info),
-                                  JS_GetTypeName(context,
-                                                 JS_TypeOfValue(context, current_arg)));
+                                  gjs_get_type_name(current_arg));
                         failed = true;
                         break;
                     }
@@ -1311,9 +1310,8 @@ function_call(JSContext *context,
 
     priv = priv_from_js(context, callee);
     gjs_debug_marshal(GJS_DEBUG_GFUNCTION,
-                      "Call callee %p priv %p this obj %p %s", callee.get(),
-                      priv, object.get(),
-                      JS_GetTypeName(context, JS_TypeOfValue(context, JS::ObjectOrNullValue(object))));
+                      "Call callee %p priv %p this obj %p", callee.get(),
+                      priv, object.get());
 
     if (priv == NULL)
         return true; /* we are the prototype, or have the wrong class */


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