From 9f2cce2415d1f75565cc5ceff521dc46653ed34a Mon Sep 17 00:00:00 2001 From: Sascha Kolewa Date: Mon, 10 Jan 2011 17:37:48 +0100 Subject: Added try catch around JSON.stringify avoids stopped tests due to exceptions in formatting --- src/imports/testlib/TestCase.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index ccaad8f..d696f84 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -260,7 +260,11 @@ Item { return "Qt.vector3d(" + value.x + ", " + value.y + ", " + value.z + ")" } - return JSON.stringify(value) + try { + return JSON.stringify(value) + } catch (ex) { + // stringify might fail (e.g. due to circular references) + } } return value } -- cgit v1.2.3