JSDOC/Symbol.js
[gnome.introspection-doc-generator] / JSDOC / Symbol.js
index 10dff41..159e79f 100644 (file)
@@ -63,20 +63,11 @@ Symbol = XObject.define(
         
             
         
-        toObject : function()
+        toJSON : function()
         {
             
-            function array2object(a)
-            {
-                
-                var r = [];
-                a.forEach(function(e) {
-                    r.push(e.toObject());
-                });
-                return r;
-            }
-            
-            var ret = { };
+           
+            var ret = { '*object' : 'Symbol' };
             for (var i in this) {
                 if (Symbol.hide.indexOf(i) > -1) {
                     continue;
@@ -97,22 +88,10 @@ Symbol = XObject.define(
                             case 'requires':
                             case 'returns':
                             case 'see':
-                                ret[i] = array2object(this[i],true); 
-                                continue;
-
-                                
                             case 'cfgs': // key val of doctags..
-                                ret[i] = {}
-                                for(k in this[i]) {
-                                    ret[i][k] = this[i][k].toObject()
-                                }
-                                continue;
-                            //objects..
-                            
                             case 'comment' :
-                                print(JSON.stringify(this[i]));
-                                ret[i] = this[i].toObject();
-                                continue;
+                                ret[i] = this[i]
+                                continue; 
                             
                             //skip
                             case 'inheritsFrom':
@@ -472,9 +451,10 @@ Symbol = XObject.define(
                 // @static
             if (this.comment.getTag("singleton").length) {
                 this.isStatic = true;
-                //if (this.isa == "CONSTRUCTOR") {
-                //     this.isNamespace = true;
-                //}
+                print('------------- got singleton ---------------' + this.isa);
+                if (this.isa == "CONSTRUCTOR") {
+                       this.isNamespace = true;
+                }
             }
             
             
@@ -684,6 +664,11 @@ Symbol = XObject.define(
             if (memberOfs.length) {
                 this.memberOf = memberOfs[0].desc;
                 this.memberOf = this.memberOf.replace(/\.prototype\.?/g, "#");
+                this.name = this.name.split('.').pop();
+                this.name = this.name.split('#').pop();
+                this.name = this.memberOf + this.name;
+                this._name = this.name
+                this.alias = this.name;
             }
 
             /*~t
@@ -841,4 +826,4 @@ Symbol.fromDump = function(t)
         ns[i] = t[i];
     }
     return ns;
-}
\ No newline at end of file
+}