bug fix - when setting a custom attr that points to self, the setAttrs method no longer gets stuck in a recursive loop throwing a stack overflow error. Also, objects that were instantiated from a class (non-literal objects) are no longer serializable

This commit is contained in:
Eric Rowell
2012-05-26 18:31:13 -07:00
parent fd6bdb570c
commit 44ba6f7e5b
6 changed files with 87 additions and 30 deletions

View File

@@ -157,10 +157,10 @@ Kinetic.Node.prototype = {
}
/*
* if property is an object, then add an empty object
* if property is a pure object (no methods), then add an empty object
* to the node and then traverse
*/
if(go._isObject(val) && !go._isArray(val) && !go._isElement(val)) {
if(go._isObject(val) && !go._isArray(val) && !go._isElement(val) && !go._hasMethods(val)) {
if(obj[key] === undefined) {
obj[key] = {};
}