diff options
Diffstat (limited to 'tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml')
-rw-r--r-- | tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml b/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml index e21aab1f01..c127407eae 100644 --- a/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml +++ b/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml @@ -66,12 +66,20 @@ Item { } function checkMapAToInvalid(x, y, w, h) { - var pos = itemA.mapToItem(1122, x, y, w, h) - return pos == undefined; + try { + itemA.mapToItem(1122, x, y, w, h) + } catch (e) { + return e instanceof TypeError + } + return false; } function checkMapAFromInvalid(x, y, w, h) { - var pos = itemA.mapFromItem(1122, x, y, w, h) - return pos == undefined; + try { + itemA.mapFromItem(1122, x, y, w, h) + } catch (e) { + return e instanceof TypeError + } + return false; } } |