JSDOC/DocComment.js
[gnome.introspection-doc-generator] / JSDOC / DocComment.js
index b76f67c..db4361a 100644 (file)
@@ -26,34 +26,31 @@ DocComment = XObject.define(
     }, 
     Object, // extends
     {
-        this.isUserComment = true;
-        this.src           = "";
-        this.meta          = "";
-        this.tagTexts      = [];
-        this.tags          = [];     
+        isUserComment = true;
+        src           : "",
+        meta          : "",
+        tagTexts      : [],
+        tags          : [],     
     
         /**
          * serialize..
          */
         toObject :function(t)
         {
-            
-            var ret = { };
-            for (var i in this) {
-                switch (typeof(this[i])) {
-                    case 'function':
-                       continue;
-                       continue;
-                        
-                    case 'string':
-                    case 'number':
-                    case 'boolean':                    
-                        ret[i] = this[i]; continue;
-                    default:
-                        print("unknown type:" + typeof(this[i]));
-                        Seed.quit();
-                   }
+            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;
         },    
         /**