JSDOC/DocComment.js
[gnome.introspection-doc-generator] / JSDOC / DocComment.js
index b76f67c..cd26605 100644 (file)
@@ -26,34 +26,25 @@ 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)
+        toJSON :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();
-                   }
-            }
+            var ret = { _object : 'DocComment' };
+            
+            var _this = this;
+            ['isUserComment','src', 'meta',  'tags'].forEach(function(k) {
+                ret[k] = _this[k];
+            })
+            
             return ret;
         },    
         /**