From 2cd89f3028900e32971b3d3af9caecad4fdbdcf9 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Fri, 25 Jan 2013 23:14:39 +0100 Subject: [PATCH] do not abort printing objects when toString() throws --- js/common/bootstrap/module-internal.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/common/bootstrap/module-internal.js b/js/common/bootstrap/module-internal.js index a55e9547a3..d6a29e6bcc 100644 --- a/js/common/bootstrap/module-internal.js +++ b/js/common/bootstrap/module-internal.js @@ -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);