Hide internal properties even if they are enumerable in Base#toString()

This commit is contained in:
Jürg Lehni 2011-08-02 08:32:55 +01:00
parent 14881b8b19
commit 2d5788540d

View file

@ -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(', ') + ' }';
},