sync
authorAlan Knowles <alan@roojs.com>
Wed, 23 Nov 2011 05:13:45 +0000 (13:13 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 23 Nov 2011 05:13:45 +0000 (13:13 +0800)
JSDOC/DocComment.js
JSDOC/ScopeNamer.js
JsTemplate/Link.js

index 66be7cf..97af318 100644 (file)
@@ -194,10 +194,7 @@ DocComment = XObject.define(
 });
 
 
-/// static methods..
-/**
- * @scope JSDOC
- */
 XObject.extend(DocComment, 
     {
         
index e0be6a2..17d061c 100644 (file)
@@ -210,7 +210,24 @@ ScopeNamer = XObject.define(
                     if (this.lookTok(-1).data == '=' &&
                         this.lookTok(-2).is('NAME')
                     ) {
+                        
                         name = this.lookTok(-2).data;
+                        
+                        if (!isGlobal) {
+                            // only this.*
+                            if (this.lookTok(-3).name == 'VAR') { 
+                                name = '';
+                            }
+                            if (name.match(/^this\./) && scope.match(/\.prototype$/)) {
+                                name = name.substring(5);
+                            }
+                            if (name.split('.').length > 1) {
+                                name = '';
+                            }
+                            
+                        }
+                        
+                        
                         this.walkFunctionDef(scope, name, this.lookTok(1).args, this.lookTok(2).items, this.lookTok(-2));
                         continue;
                     }
@@ -252,12 +269,19 @@ ScopeNamer = XObject.define(
                     // only register names of objects if 
                     var name = this.lookTok(-2).data;
                     
-                    if (isGlobal) {
-                        print ("GLOBAL: ")
+                    // some a = {} can be hidden
+                    // using @type {string} for example.
+                    // FIXME - they should be registered as a property...
+                    if (jd && jd.jsdoc && jd.jsdoc.getTag('type').length) {
                         
+                         
+                        name = false;
+                    }
+                    
+                     
                         
                         
-                    } else {
+                    if (!isGlobal) {
                         // not global.
                         if (isVar) {
                             name = false;
index b450d5e..b3cc46d 100644 (file)
@@ -236,7 +236,9 @@ Link.symbolNameToLinkName = function(symbol) {
        return Link.hashPrefix+linker+symbol.name;
 }
 
-
+/**
+ * @type {Object}
+ */
 Link.builtins = {
     'Object' : 'http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object',
     'Object...' : 'http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object',