X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FSymbol.js;h=7385547cb342ccdf68c7a7246ca3c4d878bb2a90;hb=3c287c0bc7f97e6b840f52522b4f4f72f0551669;hp=d4dac3a511c88c34cf7e10ee321d3348af8befbc;hpb=50476ada7a8859d77838c86428fba156eeaef45e;p=gnome.introspection-doc-generator diff --git a/JSDOC/Symbol.js b/JSDOC/Symbol.js index d4dac3a..7385547 100644 --- a/JSDOC/Symbol.js +++ b/JSDOC/Symbol.js @@ -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': @@ -127,9 +106,12 @@ Symbol = XObject.define( case 'string': case 'number': + case 'boolean': ret[i] = this[i]; continue; default: + print("unknown type:" + typeof(this[i])); + print(JSON.stringify(this)); Seed.quit(); } } @@ -376,6 +358,7 @@ Symbol = XObject.define( // @class var classes = this.comment.getTag("class"); if (classes.length) { + //print(JSON.stringify(this,null,4)); this.isa = "CONSTRUCTOR"; this.classDesc = classes[0].desc; // desc can't apply to the constructor as there is none. if (!this.classDesc) { @@ -471,6 +454,7 @@ Symbol = XObject.define( // @static if (this.comment.getTag("singleton").length) { this.isStatic = true; + //print('------------- got singleton ---------------' + this.isa); //if (this.isa == "CONSTRUCTOR") { // this.isNamespace = true; //} @@ -683,6 +667,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 @@ -840,4 +829,4 @@ Symbol.fromDump = function(t) ns[i] = t[i]; } return ns; -} \ No newline at end of file +}