[gjs/wip/ptomato/internals: 4/6] WIP - js: Remove deprecated gjs-internals API



commit 1455ca874e93b9d079834ab928f964df87a6caf4
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Sep 19 21:22:48 2016 -0700

    WIP - js: Remove deprecated gjs-internals API
    
    Now this API is not public anymore, the deprecated functions can be
    removed.

 Makefile.am                 |    1 -
 gjs/compat.h                |   23 ----
 gjs/jsapi-dynamic-class.cpp |   14 --
 gjs/jsapi-util-array.cpp    |  305 -------------------------------------------
 gjs/jsapi-util.cpp          |   18 ---
 gjs/jsapi-util.h            |   44 ------
 6 files changed, 0 insertions(+), 405 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index d5dc6d2..b4c15c9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -82,7 +82,6 @@ libgjs_la_SOURCES =           \
        gjs/jsapi-private.h             \
        gjs/jsapi-util.cpp      \
        gjs/jsapi-dynamic-class.cpp \
-       gjs/jsapi-util-array.cpp        \
        gjs/jsapi-util-error.cpp        \
        gjs/jsapi-util-string.cpp       \
        gjs/mem.cpp             \
diff --git a/gjs/compat.h b/gjs/compat.h
index ccf17b7..329f259 100644
--- a/gjs/compat.h
+++ b/gjs/compat.h
@@ -41,30 +41,7 @@ _Pragma("clang diagnostic pop")
 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
 _Pragma("GCC diagnostic pop")
 #endif
-#include <stdbool.h>
-#include <glib.h>
 
 #include "jsapi-util.h"
 
-G_BEGIN_DECLS
-
-#define JSVAL_IS_OBJECT(obj) \
-    _Pragma("GCC warning \"JSVAL_IS_OBJECT is deprecated. Use JS::Value::isObjectOrNull() instead.\"") \
-    ((obj).isObjectOrNull())
-
-#define JS_GetGlobalObject(cx) \
-    _Pragma("GCC warning \"JS_GetGlobalObject is deprecated. Use JS_GetGlobalForObject() or 
JS_GetGlobalForScopeChain() instead.\"") \
-    gjs_get_global_object(cx)
-
-static bool G_GNUC_UNUSED G_GNUC_DEPRECATED_FOR(JS::NumberValue)
-JS_NewNumberValue(JSContext *cx,
-                  double     d,
-                  JS::Value *rval)
-    {
-        *rval = JS_NumberValue(d);
-        return rval->isNumber();
-    }
-
-G_END_DECLS
-
 #endif  /* __GJS_COMPAT_H__ */
diff --git a/gjs/jsapi-dynamic-class.cpp b/gjs/jsapi-dynamic-class.cpp
index c87fc9b..2581b2a 100644
--- a/gjs/jsapi-dynamic-class.cpp
+++ b/gjs/jsapi-dynamic-class.cpp
@@ -35,20 +35,6 @@
 #include <string.h>
 #include <math.h>
 
-/*
- * This shim was because of a bug in JS_NewObjectForConstructor in JS 1.8.5. It
- * attempted to retrieve the JSClass from private fields in the constructor
- * function, which failed for our "dynamic classes".
- * This function is deprecated.
- */
-JSObject *
-gjs_new_object_for_constructor(JSContext *context,
-                               JSClass   *clasp,
-                               JS::Value *vp)
-{
-    return JS_NewObjectForConstructor(context, clasp, vp);
-}
-
 bool
 gjs_init_class_dynamic(JSContext       *context,
                        JSObject        *in_object,
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 3e7b169..11d918d 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -815,24 +815,6 @@ gjs_get_type_name(JS::Value value)
     }
 }
 
-/**
- * gjs_value_to_int64:
- * @context: the Javascript context object
- * @val: Javascript value to convert
- * @result: location to store the return value
- *
- * Converts a Javascript value into the nearest 64 bit signed value.
- *
- * Deprecated: Use JS::ToInt64() instead.
- */
-bool
-gjs_value_to_int64(JSContext      *context,
-                   const JS::Value val,
-                   gint64         *result)
-{
-    return JS::ToInt64(context, val, (int64_t *) result);
-}
-
 static bool
 gjs_parse_args_valist (JSContext  *context,
                        const char *function_name,
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index eaf5850..939ed6c 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -273,11 +273,6 @@ bool        gjs_object_require_property      (JSContext       *context,
                                               jsid             property_name,
                                               JS::Value       *value_p);
 
-JSObject   *gjs_new_object_for_constructor   (JSContext       *context,
-                                              JSClass         *clasp,
-                                              JS::Value       *vp)
-G_GNUC_DEPRECATED_FOR(JS_NewObjectForConstructor);
-
 bool        gjs_init_class_dynamic           (JSContext       *context,
                                               JSObject        *in_object,
                                               JSObject        *parent_proto,
@@ -401,11 +396,6 @@ bool        gjs_unichar_from_string          (JSContext       *context,
 
 const char* gjs_get_type_name                (JS::Value        value);
 
-bool        gjs_value_to_int64               (JSContext       *context,
-                                              const JS::Value  val,
-                                              gint64          *result)
-G_GNUC_DEPRECATED_FOR(JS::ToInt64);
-
 bool        gjs_parse_args                   (JSContext  *context,
                                               const char *function_name,
                                               const char *format,
@@ -419,40 +409,6 @@ bool        gjs_parse_call_args              (JSContext    *context,
                                               JS::CallArgs &args,
                                               ...);
 
-GjsRootedArray*   gjs_rooted_array_new        (void)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector);
-void              gjs_rooted_array_append     (JSContext        *context,
-                                               GjsRootedArray *array,
-                                               JS::Value       value)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector::append);
-JS::Value         gjs_rooted_array_get        (JSContext      *context,
-                                               GjsRootedArray *array,
-                                               int             i)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector::operator[]);
-JS::Value        *gjs_rooted_array_get_data   (JSContext        *context,
-                                               GjsRootedArray *array)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector::operator[]);
-int               gjs_rooted_array_get_length (JSContext        *context,
-                                               GjsRootedArray *array)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector::length);
-JS::Value        *gjs_rooted_array_free       (JSContext        *context,
-                                               GjsRootedArray *array,
-                                               bool              free_segment)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector);
-void              gjs_set_values              (JSContext        *context,
-                                               JS::Value        *locations,
-                                               int               n_locations,
-                                               JS::Value         initializer)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector);
-void              gjs_root_value_locations    (JSContext        *context,
-                                               JS::Value        *locations,
-                                               int               n_locations)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector);
-void              gjs_unroot_value_locations  (JSContext        *context,
-                                               JS::Value        *locations,
-                                               int               n_locations)
-G_GNUC_DEPRECATED_FOR(JS::AutoValueVector);
-
 /* Functions intended for more "internal" use */
 
 void gjs_maybe_gc (JSContext *context);


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