JSDOC/Symbol.js
[gnome.introspection-doc-generator] / JSDOC / Symbol.js
index fe29b2a..d781e52 100644 (file)
@@ -49,10 +49,10 @@ Symbol = XObject.define(
         methods : [], // Symbol[]
         _name : "",
         _params : [], //Doctag[]
-        properties : [],
-        requires : [],
-        returns : [],
-        see : [],
+        properties : [], //Doctag[]
+        requires : [],  //Doctag[]
+        returns : [], //Doctag[]
+        see : [], //Doctag[]
         since : "",
         srcFile : {},
         type : "",
@@ -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;
@@ -93,16 +84,20 @@ Symbol = XObject.define(
                             case 'inherits' :
                             case 'methods' :
                             case '_params': 
-                                ret[i] = array2object(this[i],true); 
-                                continue;
-                                
-                            //objects..
-                            
+                            case 'properties': 
+                            case 'requires':
+                            case 'returns':
+                            case 'see':
+                            case 'cfgs': // key val of doctags..
                             case 'comment' :
-                                print(JSON.stringify(this[i]));
-                                ret[i] = this[i].toObject();
+                                ret[i] = this[i]
+                                continue; 
+                            
+                            //skip
+                            case 'inheritsFrom':
+                            case 'childClasses':
                                 continue;
-                                
+            
                             default:
                                 print("object? :" + i);
                                 Seed.quit();
@@ -111,6 +106,7 @@ Symbol = XObject.define(
                         
                     case 'string':
                     case 'number':
+                    case 'boolean':
                         ret[i] = this[i]; continue;
                     default:
                         print("unknown type:" + typeof(this[i]));
@@ -130,7 +126,7 @@ Symbol = XObject.define(
             //this.events = [];
             this.exceptions = [];
             this.inherits = [];
-            //this.inheritsFrom = [];
+            //
             this.isa = "OBJECT"; // OBJECT//FUNCTION
             this.methods = [];
             this._params = [];
@@ -139,8 +135,12 @@ Symbol = XObject.define(
             this.returns = [];
             this.see = [];
             this.srcFile = {};
-            this.childClasses = [];
+            
+            
             this.cfgs = {};
+            // derived later?
+            this.inheritsFrom = [];
+            this.childClasses = [];
             
             this.comment = new DocComment();
             this.comment.isUserComment =  false;