mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Cleanup and fix ProxyContext.
This commit is contained in:
parent
507ff8bb23
commit
b75e75f586
1 changed files with 6 additions and 8 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue