using getter overloader for toObject() method

This commit is contained in:
Eric Rowell
2014-01-21 00:00:38 -08:00
parent 99719bad44
commit 82db0dd843

View File

@@ -970,7 +970,7 @@
for(key in attrs) {
val = attrs[key];
if (!type._isFunction(val) && !type._isElement(val) && !(type._isObject(val) && type._hasMethods(val))) {
getter = this[GET + Kinetic.Util._capitalize(key)];
getter = this[key];
// remove attr value so that we can extract the default value from the getter
delete attrs[key];
defaultValue = getter ? getter.call(this) : null;