Removing code added during the migration. freeVariable(..) is called with

a `type` at all times.
This commit is contained in:
Stan Angeloff
2010-09-19 15:37:26 +03:00
parent bb35b3e3b2
commit 408833daef
2 changed files with 8 additions and 26 deletions

View File

@@ -12,9 +12,7 @@
this.expressions = _cache[1];
this.method = _cache[2];
this.variables = {};
this.tempVars = {
general: '_a'
};
this.tempVars = {};
if (this.parent) {
_cache2 = this.parent.tempVars;
for (k in _cache2) {
@@ -60,18 +58,9 @@
};
Scope.prototype.freeVariable = function(type) {
var next;
if (type) {
next = function(prev) {
return '_' + type + ((prev && Number(prev.match(/\d+$/) || 1) + 1) || '');
};
} else {
type = 'general';
next = function(prev) {
var ordinal;
ordinal = 1 + parseInt(prev.substr(1), 36);
return '_' + ordinal.toString(36).replace(/\d/g, 'a');
};
}
next = function(prev) {
return '_' + type + ((prev && Number(prev.match(/\d+$/) || 1) + 1) || '');
};
while (this.check(this.tempVars[type] || (this.tempVars[type] = next()))) {
this.tempVars[type] = next(this.tempVars[type]);
}