mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -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') {
|
if (name == 'restore') {
|
||||||
this._indents--;
|
this._indents--;
|
||||||
}
|
}
|
||||||
var args = Array.prototype.slice.call(arguments, 0);
|
var args = Array.prototype.slice.call(arguments, 0).join(', '),
|
||||||
var string = 'ctx.' + name + '(' + args.join(', ') + ')';
|
string = 'ctx.' + name + '(' + args + ');';
|
||||||
console.log(this.getIndentation() + string + ';');
|
console.log(this.getIndentation() + string);
|
||||||
this._ctx[name].apply(this._ctx, arguments);
|
this._ctx[name].apply(this._ctx, arguments);
|
||||||
if (name == 'save') {
|
if (name == 'save') {
|
||||||
this._indents++;
|
this._indents++;
|
||||||
|
@ -79,11 +79,9 @@ var ProxyContext = new function() {
|
||||||
} else {
|
} else {
|
||||||
var capitalized = Base.capitalize(name);
|
var capitalized = Base.capitalize(name);
|
||||||
param['set' + capitalized] = function(value) {
|
param['set' + capitalized] = function(value) {
|
||||||
if (value.substring) {
|
var logValue = value.substring ? '\'' + value + '\'' : value,
|
||||||
value = '\'' + value + '\'';
|
string = 'ctx.' + name + ' = ' + logValue + ';';
|
||||||
}
|
console.log(this.getIndentation() + string);
|
||||||
var string = 'ctx.' + name + ' = ' + value;
|
|
||||||
console.log(this.getIndentation() + string + ';');
|
|
||||||
return this._ctx[name] = value;
|
return this._ctx[name] = value;
|
||||||
};
|
};
|
||||||
param['get' + capitalized] = function() {
|
param['get' + capitalized] = function() {
|
||||||
|
|
Loading…
Reference in a new issue