From 358d9a05450d8f1a36131043d9d2c279e736760c Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Apr 2010 12:20:48 +0800 Subject: [PATCH] JSDOC/Scope.js --- JSDOC/Scope.js | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/JSDOC/Scope.js b/JSDOC/Scope.js index 49d6cbd..8c5e725 100644 --- a/JSDOC/Scope.js +++ b/JSDOC/Scope.js @@ -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+'
'); -- 2.39.2