mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -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() {
|
||||
return '{ ' + Base.each(this, function(value, key) {
|
||||
var type = typeof value;
|
||||
this.push(key + ': ' + (type === 'number' ? Base.formatNumber(value)
|
||||
: type === 'string' ? "'" + value + "'" : value));
|
||||
// Hide internal properties even if they are enumerable
|
||||
if (key.charAt(0) != '_') {
|
||||
var type = typeof value;
|
||||
this.push(key + ': ' + (type === 'number'
|
||||
? Base.formatNumber(value)
|
||||
: type === 'string' ? "'" + value + "'" : value));
|
||||
}
|
||||
}, []).join(', ') + ' }';
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue