mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Hide internal properties even if they are enumerable in Base#toString()
This commit is contained in:
parent
14881b8b19
commit
2d5788540d
1 changed files with 7 additions and 3 deletions
|
@ -40,9 +40,13 @@ this.Base = Base.inject(/** @lends Base# */{
|
||||||
*/
|
*/
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return '{ ' + Base.each(this, function(value, key) {
|
return '{ ' + Base.each(this, function(value, key) {
|
||||||
var type = typeof value;
|
// Hide internal properties even if they are enumerable
|
||||||
this.push(key + ': ' + (type === 'number' ? Base.formatNumber(value)
|
if (key.charAt(0) != '_') {
|
||||||
: type === 'string' ? "'" + value + "'" : value));
|
var type = typeof value;
|
||||||
|
this.push(key + ': ' + (type === 'number'
|
||||||
|
? Base.formatNumber(value)
|
||||||
|
: type === 'string' ? "'" + value + "'" : value));
|
||||||
|
}
|
||||||
}, []).join(', ') + ' }';
|
}, []).join(', ') + ' }';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue