diff --git a/Foundation/CPArray/CPArray.j b/Foundation/CPArray/CPArray.j index 78c462aae..a4bf453fd 100755 --- a/Foundation/CPArray/CPArray.j +++ b/Foundation/CPArray/CPArray.j @@ -807,7 +807,18 @@ var concat = Array.prototype.concat, description += '\n'; var object = [self objectAtIndex:index], - objectDescription = object && object.isa ? [object description] : String(object); + desc = object; + if (object && typeof(object) === "object" && !object.isa) + { + desc = "JSObject\n{\n"; + for (var property in object) + { + if (object.hasOwnProperty(property)) + desc += " " + property + ":" + object[property] + "\n"; + } + desc += "}"; + } + var objectDescription = object && object.isa ? [object description] : String(desc); description += "\t" + objectDescription.split('\n').join("\n\t"); diff --git a/Objective-J/CFDictionary.js b/Objective-J/CFDictionary.js index 99fd02fb4..33a9d617d 100644 --- a/Objective-J/CFDictionary.js +++ b/Objective-J/CFDictionary.js @@ -142,9 +142,21 @@ CFDictionary.prototype.toString = function() for (; index < count; ++index) { - var key = keys[index]; + var key = keys[index], + value = this.valueForKey(key), + description = value; + if (value && typeof(value) === "object" && !value.isa) + { + description = "JSObject\n{\n"; + for (var property in value) + { + if (value.hasOwnProperty(property)) + description += " " + property + ":" + value[property] + "\n"; + } + description += "}"; + } - string += "\t" + key + " = \"" + String(this.valueForKey(key)).split('\n').join("\n\t") + "\"\n"; + string += "\t" + key + " = \"" + String(description).split('\n').join("\n\t") + "\"\n"; } return string + "}";