Only do cycle checking for actual pointers -- otherwise two of the same integers or strings in sequence trigger it, which is briefly amusing but ultimately quite undesirable.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5078 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Par Winzell
2008-05-11 21:44:23 +00:00
parent 3b5e956f35
commit 513ad0fe32
+3 -1
View File
@@ -283,6 +283,7 @@ public class StringUtil
return String(obj); return String(obj);
} }
if (obj is Array || Util.isPlainObject(obj)) {
if (refs == null) { if (refs == null) {
refs = new Dictionary(); refs = new Dictionary();
@@ -303,7 +304,7 @@ public class StringUtil
} }
return "Array(" + s + ")"; return "Array(" + s + ")";
} else if (Util.isPlainObject(obj)) { } else {
// TODO: maybe do this for any dynamic object? (would have to use describeType) // TODO: maybe do this for any dynamic object? (would have to use describeType)
s = ""; s = "";
for (var prop :String in obj) { for (var prop :String in obj) {
@@ -313,6 +314,7 @@ public class StringUtil
s += prop + "=>" + toString(obj[prop], refs); s += prop + "=>" + toString(obj[prop], refs);
} }
return "Object(" + s + ")"; return "Object(" + s + ")";
}
} else if (obj is XML) { } else if (obj is XML) {
return Util.XMLtoXMLString(obj as XML); return Util.XMLtoXMLString(obj as XML);