Skip to content

Instantly share code, notes, and snippets.

@torus
Created September 16, 2009 01:12
Show Gist options
  • Save torus/187796 to your computer and use it in GitHub Desktop.
Save torus/187796 to your computer and use it in GitHub Desktop.
public function dumpObject (o : Object) : String {
var dest : String = "";
var f : Function = function (data : Object, lev : int) : void {
var nest : String = "";
for (var l : int = 0; l < lev; l ++) nest += " ";
for (var i : String in data) {
if (typeof (data[i]) == "object") {
dest += nest + i + ":\n";
f (data[i], lev + 1);
} else {
dest += nest + i + " = " + data[i].toString () + " : " + typeof (data[i]) + "\n";
}
}
}
f (o, 0);
return dest;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment