Cleanup and fix ProxyContext.

This commit is contained in:
Jonathan Puckey 2012-03-01 23:20:15 +01:00
parent 507ff8bb23
commit b75e75f586

View file

@ -68,9 +68,9 @@ var ProxyContext = new function() {
if (name == 'restore') {
this._indents--;
}
var args = Array.prototype.slice.call(arguments, 0);
var string = 'ctx.' + name + '(' + args.join(', ') + ')';
console.log(this.getIndentation() + string + ';');
var args = Array.prototype.slice.call(arguments, 0).join(', '),
string = 'ctx.' + name + '(' + args + ');';
console.log(this.getIndentation() + string);
this._ctx[name].apply(this._ctx, arguments);
if (name == 'save') {
this._indents++;
@ -79,11 +79,9 @@ var ProxyContext = new function() {
} else {
var capitalized = Base.capitalize(name);
param['set' + capitalized] = function(value) {
if (value.substring) {
value = '\'' + value + '\'';
}
var string = 'ctx.' + name + ' = ' + value;
console.log(this.getIndentation() + string + ';');
var logValue = value.substring ? '\'' + value + '\'' : value,
string = 'ctx.' + name + ' = ' + logValue + ';';
console.log(this.getIndentation() + string);
return this._ctx[name] = value;
};
param['get' + capitalized] = function() {