JSDOC/TokenReader.js
[gnome.introspection-doc-generator] / JSDOC / SymbolSet.js
index c7ddd1f..5843a94 100644 (file)
@@ -17,11 +17,15 @@ SymbolSet = XObject.define(
     Object,
     {
         
+        _index : false,
+        
+        
         init : function() {
             this._index = {};
         },
 
-        keys : function() {
+        keys : function() 
+        {
             var found = [];
             for (var p in this._index) {
                 found.push(p);
@@ -31,12 +35,14 @@ SymbolSet = XObject.define(
 
 
         hasSymbol : function(alias) {
-            return this.keys().indexOf(alias) > -1;
+            return typeof(this._index[alias]) != 'undefined';
+            //return this.keys().indexOf(alias) > -1;
         },
 
         addSymbol : function(symbol) {
             //print("ADDING SYMBOL:"+symbol.alias.toString());
             
+            
             if (this.hasSymbol(symbol.alias)) {
                 imports.BuildDocs.Options.LOG.warn("Overwriting symbol documentation for: "+symbol.alias + ".");
             }
@@ -56,6 +62,17 @@ SymbolSet = XObject.define(
             }
             return found;
         },
+        /**
+         * for serializing
+         */
+        toJSON : function() {
+            return {
+                '*object' : 'SymbolSet',
+                _index : this._index
+            };
+            
+        },
+
 
         deleteSymbol : function(alias) {
             if (!this.hasSymbol(alias)) return;
@@ -82,6 +99,9 @@ SymbolSet = XObject.define(
         resolveBorrows : function() {
             for (p in this._index) {
                 var symbol = this._index[p];
+                
+                
+                
                 if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
                 
                 var borrows = symbol.inherits;
@@ -229,10 +249,10 @@ SymbolSet = XObject.define(
                     if (contributer) {
                         contributer.childClasses.push(symbol.alias);
                         symbol.inheritsFrom.push(contributer.alias);
-                        if (!isUnique(symbol.inheritsFrom)) {
-                            imports.BuildDocs.Options.LOG.warn("Can't resolve augments: Circular reference: "+symbol.alias+" inherits from "+contributer.alias+" more than once.");
-                        }
-                        else {
+                        //if (!isUnique(symbol.inheritsFrom)) {
+                        //    imports.BuildDocs.Options.LOG.warn("Can't resolve augments: Circular reference: "+symbol.alias+" inherits from "+contributer.alias+" more than once.");
+                        //}
+                        //else {
                             var cmethods = contributer.methods;
                             var cproperties = contributer.properties;
                             var cfgs = contributer.cfgs;
@@ -247,7 +267,7 @@ SymbolSet = XObject.define(
                             }
                             
                                 
-                        }
+                        //}
                     }
                     else {
                         
@@ -305,12 +325,8 @@ SymbolSet = XObject.define(
             addAugments(symbol.augments, true);
             //while(addAugments(symbol.augments) >  0) { }
             
-        },
-        
-        toArray : function()
-        {
-            
-           }
+        }
+         
 })
 
 SymbolSet.isBuiltin = function(name) {