1
0
Fork 0

do not abort printing objects when toString() throws

This commit is contained in:
Jan Steemann 2013-01-25 23:14:39 +01:00
parent 17098dd4ef
commit 2cd89f3028
1 changed files with 6 additions and 1 deletions

View File

@ -446,7 +446,12 @@
printObject(value, seen, path, names, level);
}
else if (typeof value.toString === "function") {
output(value.toString());
// it's possible that toString() throws, and this looks quite ugly
try {
output(value.toString());
}
catch (e) {
}
}
else {
printObject(value, seen, path, names, level);