[gjs] gi: Cleanup gjs_define_gi_stuff()



commit 0b9ad768c524f9cc22c6366e9156cf9d2814adc1
Author: Philip Chimento <philip endlessm com>
Date:   Fri Jan 27 17:50:28 2017 -0800

    gi: Cleanup gjs_define_gi_stuff()
    
    This function was identical to gjs_define_repo(), so we can remove it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777205

 Makefile.am     |    2 --
 gi/object.cpp   |    1 -
 gi/object.h     |    3 +++
 gi/proxyutils.h |    1 -
 gi/repo.cpp     |    3 +--
 gi/repo.h       |    3 +--
 gjs/context.cpp |    5 ++---
 gjs/gi.cpp      |   39 ---------------------------------------
 gjs/gi.h        |   41 -----------------------------------------
 9 files changed, 7 insertions(+), 91 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index f9c8ceb..0d3406d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -80,8 +80,6 @@ libgjs_la_SOURCES =           \
        gjs/context.cpp         \
        gjs/context-private.h           \
        gjs/importer.cpp                \
-       gjs/gi.h                \
-       gjs/gi.cpp              \
        gjs/coverage-internal.h \
        gjs/coverage.cpp \
        gjs/jsapi-constructor-proxy.cpp \
diff --git a/gi/object.cpp b/gi/object.cpp
index 8da0403..0248d46 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -28,7 +28,6 @@
 #include <string.h>
 #include <vector>
 
-#include "gjs/gi.h"
 #include "object.h"
 #include "gtype.h"
 #include "interface.h"
diff --git a/gi/object.h b/gi/object.h
index 6b22fb9..92744e1 100644
--- a/gi/object.h
+++ b/gi/object.h
@@ -63,6 +63,9 @@ void gjs_object_define_static_methods(JSContext       *context,
                                       GType            gtype,
                                       GIObjectInfo    *object_info);
 
+bool gjs_define_private_gi_stuff(JSContext              *cx,
+                                 JS::MutableHandleObject module);
+
 G_END_DECLS
 
 #endif  /* __GJS_OBJECT_H__ */
diff --git a/gi/proxyutils.h b/gi/proxyutils.h
index e689cb6..f344403 100644
--- a/gi/proxyutils.h
+++ b/gi/proxyutils.h
@@ -24,7 +24,6 @@
 #ifndef __GJS_PROXYUTILS_H__
 #define __GJS_PROXYUTILS_H__
 
-#include "gjs/gi.h"
 #include "gjs/jsapi-util.h"
 
 G_BEGIN_DECLS
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 4d65f3d..ccb845e 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -311,8 +311,7 @@ repo_new(JSContext *context)
 
 bool
 gjs_define_repo(JSContext              *cx,
-                JS::MutableHandleObject repo,
-                const char             *name)
+                JS::MutableHandleObject repo)
 {
     repo.set(repo_new(cx));
     return true;
diff --git a/gi/repo.h b/gi/repo.h
index a3a38fc..bde533f 100644
--- a/gi/repo.h
+++ b/gi/repo.h
@@ -35,8 +35,7 @@
 G_BEGIN_DECLS
 
 bool gjs_define_repo(JSContext              *cx,
-                     JS::MutableHandleObject repo,
-                     const char             *name);
+                     JS::MutableHandleObject repo);
 
 const char* gjs_info_type_name                  (GIInfoType      type);
 JSObject*   gjs_lookup_private_namespace        (JSContext      *context);
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 085f76c..222a178 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -36,9 +36,8 @@
 #include "native.h"
 #include "byteArray.h"
 #include "runtime.h"
-
-#include "gi.h"
 #include "gi/object.h"
+#include "gi/repo.h"
 
 #include <modules/modules.h>
 
@@ -373,7 +372,7 @@ gjs_context_class_init(GjsContextClass *klass)
 
     gjs_register_native_module("byteArray", gjs_define_byte_array_stuff);
     gjs_register_native_module("_gi", gjs_define_private_gi_stuff);
-    gjs_register_native_module("gi", gjs_define_gi_stuff);
+    gjs_register_native_module("gi", gjs_define_repo);
 
     gjs_register_static_modules();
 }


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