JSDOC/Scope.js
authoralan <alan@alanfast.akbkhome.com>
Mon, 19 Apr 2010 04:20:48 +0000 (12:20 +0800)
committeralan <alan@alanfast.akbkhome.com>
Mon, 19 Apr 2010 04:20:48 +0000 (12:20 +0800)
JSDOC/Scope.js

index 49d6cbd..8c5e725 100644 (file)
@@ -45,7 +45,7 @@ Scope.prototype = {
     braceN : -1,
     parent : false,
     subScopes : false,
-    identifiers : false, 
+    identifiers : false,  // map of identifiers to {Identifier} objects
     hints: false, 
     mungeM : true, 
     ident: '',
@@ -120,7 +120,8 @@ Scope.prototype = {
         return result;
     },
     /** - we need to register short vairalbes so they never get munged into.. */
-    addToParentScope: function(ident) {
+    addToParentScope: function(ident) 
+    {
         if (ident.length > 2) {
             return;
         }
@@ -134,7 +135,8 @@ Scope.prototype = {
         }
         
     },
-    isProtectedVar: function(ident) {
+    isProtectedVar: function(ident)
+    {
         if (ident.length > 2) {
             return false;
         }
@@ -149,9 +151,14 @@ Scope.prototype = {
         return false;
     },
     
-    
+    /**
+     * set's all the munged values on the identifiers.
+     * 
+     * 
+     */
 
-    munge :function() {
+    munge :function() 
+    {
 
         if (!this.mungeM) {
             // Stop right here if this scope was flagged as unsafe for munging.
@@ -185,30 +192,10 @@ Scope.prototype = {
                     freeSymbols.push(batch[i]);
                 }
             }
-            /*
-            var exsymbols  = function(n) {
-                if (sy.indexOf(n) > -1) {
-                    return;
-                }
-                freeSymbols.push(n);
-            }
+            
             */
             addSyms(JSDOC.Scope.ones); 
-            
-            //if (freeSymbols.length == 0) {
-            //    pickFromSet = 2;
-               // JSDOC.Scope.twos.filter(exsymbols);
-                
-            //}
-            //if (freeSymbols.length == 0) {
-            //    pickFromSet = 3;
-            //    throw "disabled  threes!"
-            //    JSDOC.Scope.threes.filter(exsymbols);
-            //    
-            //}
-            //if (freeSymbols.length == 0) {
-            //    throw  "The Compressor ran out of symbols. Aborting...???? ";
-           // }
+             
             var repsym = '';
             //println(freeSymbols.toSource());
             
@@ -228,7 +215,7 @@ Scope.prototype = {
                 
                 
                 
-                if (this.identifiers[i].constructor != JSDOC.Identifier) {
+                if (this.identifiers[i].constructor !=  Identifier) {
                     continue;
                 }
                // println("IDENT:" +i+'</BR>');