[gjs] Don't hide deprecated methods



commit 1d36738ca7e967e644946e7aab7c635aa6371145
Author: Colin Walters <walters verbum org>
Date:   Tue Oct 26 11:30:53 2010 -0400

    Don't hide deprecated methods
    
    When GJS was first created this sort of made sense to unilaterally
    axe off all deprecated API.  However, since its creation, new
    functions have been deprecated in libraries like GTK2, and it doesn't
    make sense for scripts to start exploding immediately.
    
    As for handling this better: A strawman proposal is some environment
    variable like G_SCRIPT_RECORD_DEPRECATED=1 which prints exactly one
    warning for each deprecated method?  Opinions?
    
    https://bugzilla.gnome.org/show_bug.cgi?id=633202

 gi/boxed.c  |   12 ------------
 gi/object.c |   13 -------------
 gi/union.c  |   11 -----------
 3 files changed, 0 insertions(+), 36 deletions(-)
---
diff --git a/gi/boxed.c b/gi/boxed.c
index be28cb1..5572b60 100644
--- a/gi/boxed.c
+++ b/gi/boxed.c
@@ -121,18 +121,6 @@ boxed_new_resolve(JSContext *context,
 
             method_name = g_base_info_get_name( (GIBaseInfo*) method_info);
 
-            /* we do not define deprecated methods in the prototype */
-            if (g_base_info_is_deprecated( (GIBaseInfo*) method_info)) {
-                gjs_debug(GJS_DEBUG_GBOXED,
-                          "Ignoring definition of deprecated method %s in prototype %s.%s",
-                          method_name,
-                          g_base_info_get_namespace( (GIBaseInfo*) priv->info),
-                          g_base_info_get_name( (GIBaseInfo*) priv->info));
-                g_base_info_unref( (GIBaseInfo*) method_info);
-                ret = JS_TRUE;
-                goto out;
-            }
-
             gjs_debug(GJS_DEBUG_GBOXED,
                       "Defining method %s in prototype for %s.%s",
                       method_name,
diff --git a/gi/object.c b/gi/object.c
index e059228..7e090d9 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -349,19 +349,6 @@ object_instance_new_resolve(JSContext *context,
 
             method_name = g_base_info_get_name( (GIBaseInfo*) method_info);
 
-            /* we do not define deprecated methods in the prototype */
-            if (g_base_info_is_deprecated( (GIBaseInfo*) method_info)) {
-                gjs_debug(GJS_DEBUG_GOBJECT,
-                          "Ignoring definition of deprecated method %s in prototype for %s (%s.%s)",
-                          method_name,
-                          g_type_name(priv->gtype),
-                          g_base_info_get_namespace( (GIBaseInfo*) priv->info),
-                          g_base_info_get_name( (GIBaseInfo*) priv->info));
-                g_base_info_unref( (GIBaseInfo*) method_info);
-                ret = JS_TRUE;
-                goto out;
-            }
-
             gjs_debug(GJS_DEBUG_GOBJECT,
                       "Defining method %s in prototype for %s (%s.%s)",
                       method_name,
diff --git a/gi/union.c b/gi/union.c
index 0e78e8e..b5f8f9a 100644
--- a/gi/union.c
+++ b/gi/union.c
@@ -106,17 +106,6 @@ union_new_resolve(JSContext *context,
 
             method_name = g_base_info_get_name( (GIBaseInfo*) method_info);
 
-            /* we do not define deprecated methods in the prototype */
-            if (g_base_info_is_deprecated( (GIBaseInfo*) method_info)) {
-                gjs_debug(GJS_DEBUG_GBOXED,
-                          "Ignoring definition of deprecated method %s in prototype %s.%s",
-                          method_name,
-                          g_base_info_get_namespace( (GIBaseInfo*) priv->info),
-                          g_base_info_get_name( (GIBaseInfo*) priv->info));
-                g_base_info_unref( (GIBaseInfo*) method_info);
-                goto out;
-            }
-
             gjs_debug(GJS_DEBUG_GBOXED,
                       "Defining method %s in prototype for %s.%s",
                       method_name,



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