From 2d5788540d3e3f050a6642a3888fb89422f55577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 2 Aug 2011 08:32:55 +0100 Subject: [PATCH] Hide internal properties even if they are enumerable in Base#toString() --- src/core/Base.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/Base.js b/src/core/Base.js index b6f580a1..009c779f 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -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(', ') + ' }'; },