JSDOC/DocComment.js
[gnome.introspection-doc-generator] / JSDOC / DocComment.js
index a21d863..36baaa4 100644 (file)
@@ -19,16 +19,41 @@ DocComment = XObject.define(
         this.src           = "";
         this.meta          = "";
         this.tagTexts      = [];
-        this.tags          = [];
+        this.tags          = []; // array of doctags..
         if (typeof comment != "undefined") {
             this.parse(comment);
         }
     }, 
     Object, // extends
     {
-             
+        this.isUserComment = true;
+        this.src           = "";
+        this.meta          = "";
+        this.tagTexts      = [];
+        this.tags          = [];     
     
-        
+        /**
+         * serialize..
+         */
+        toObject :function(t)
+        {
+            function array2object(a)
+            {
+                
+                var r = [];
+                a.forEach(function(e) {
+                    r.push(e.toObject());
+                })
+            }
+            var ret = { };
+            var _this = this;
+            ['isUserComment','src', 'meta',  'tags'].forEach(function(k) {
+                ret[k] = _this[k];
+            })
+            ret.tags = array2object(this.tags,true);
+            
+            return ret;
+        },    
         /**
         * @requires JSDOC.DocTag
         */