DependTree/Window.bjs
[app.Builder.js] / DependTree / BuildLists.js
index 68995ac..2c858dd 100644 (file)
@@ -34,8 +34,7 @@ File        = imports.File.File;
  
 // Introspecion specific..
 NameSpace   = imports.Introspect.NameSpace.NameSpace; 
-Link        = imports.Introspect.Link.Link; 
-
 
 
 function BuildLists () {
@@ -69,6 +68,8 @@ function BuildLists () {
     var implementations = {};
     var methods = {};
     var allmethods = [];  
+    var allchildren = [];  
+    
     
     for (cls in classes) {
         var odata = classes[cls];
@@ -85,18 +86,27 @@ function BuildLists () {
                 }
                 // now add it..
                 
-                var full_method_name = p.memberOf + '.' + p.type;
-                if (allmethods.indexOf(full_method_name) < 0) {
-                    allmethods.push(full_method_name);
+                if (!p.type || typeof(classes[p.type]) == 'undefined') {
+                    return;
+                }
+                if (allchildren.indexOf(p.type) < 0) {
+                    allchildren.push(p.type);
                 }
                 
-                if (typeof(methods[cls][full_method_name]) == 'undefined') {
-                    methods[cls][full_method_name] = [];
+                if (typeof(methods[cls][p.type]) == 'undefined') {
+                    methods[cls][p.type] = [];
                 }
-                if (methods[cls][full_method_name].indexOf(m.name) > -1) {
+                var fullname = m.memberOf + '.' + m.name;
+                if (allmethods.indexOf(fullname) < 0) {
+                    allmethods.push(fullname);
+                }
+                
+                if (methods[cls][p.type].indexOf(fullname) > -1) {
                     return;
                 }
-                methods[cls][full_method_name].push(m.name);
+                methods[cls][p.type].push(fullname);
+                 
+                
                 
             });
             
@@ -108,8 +118,11 @@ function BuildLists () {
         
     }
     this.methods = methods;
-    this.allmethods = methods;
+    this.allmethods = allmethods;
+    this.allchildren = allchildren;
+
     this.implementations = implementations;
+    
     //print(JSON.stringify(methods,null,4));
     //print(JSON.stringify(implementations,null,4));