JSDOC/TokenReader.js
[gnome.introspection-doc-generator] / Introspect / Class.js
index 04cf8d3..9a6ee94 100644 (file)
@@ -25,6 +25,7 @@ Base = imports.Base.Base;
 Class = XObject.define(
     function(ns, name) {
         Base.call(this, ns, name);
+        //print("Class ctr - parent called");
         this.loadExtends();
         this.loadImplements();
         //console.log("CREATED(Class) " + this.alias);
@@ -39,9 +40,9 @@ Class = XObject.define(
             
             var pi = GI.object_info_get_parent(bi);
             this.extendsClasses = [];
-            if (!pi) {
+            if (!pi || (pi.get_namespace() == this.ns && pi.get_name() == this.name )) {
                 return;
-            }
+            } 
             this.parent = NameSpace.factory(
                 'Class',
                 pi.get_namespace(),
@@ -55,9 +56,21 @@ Class = XObject.define(
                 this.extendsClasses.push(p);
             },this);
             
+            if (this.parent) {
+                this.parent.addChildClass(this.alias);
+            }
             
             
         },
+        
+        addChildClass : function (n) {
+            this.childClasses.push(n);
+            if (this.parent) {
+                this.parent.addChildClass(n);
+            }
+        },
+        
+        
         loadImplements : function()
         {
             var bb = this.getBI();