aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4value.cpp')
-rw-r--r--src/qml/jsruntime/qv4value.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp
index 623f9ae3b6..3c9db5edea 100644
--- a/src/qml/jsruntime/qv4value.cpp
+++ b/src/qml/jsruntime/qv4value.cpp
@@ -124,19 +124,24 @@ QString Value::toQStringNoThrow() const
{
ExecutionContext *ctx = objectValue()->internalClass->engine->current;
Scope scope(ctx);
+ ScopedValue ex(scope);
+ bool caughtException = false;
try {
ScopedValue prim(scope, __qmljs_to_primitive(ValueRef::fromRawValue(this), STRING_HINT));
if (prim->isPrimitive())
return prim->toQStringNoThrow();
- } catch (Exception &e) {
- e.accept(ctx);
+ } catch (...) {
+ ex = ctx->catchException();
+ caughtException = true;
+ }
+ // Can't nest try/catch due to CXX ABI limitations for foreign exception nesting.
+ if (caughtException) {
try {
- ScopedValue ex(scope, e.value());
ScopedValue prim(scope, __qmljs_to_primitive(ex, STRING_HINT));
if (prim->isPrimitive())
return prim->toQStringNoThrow();
- } catch(Exception &e) {
- e.accept(ctx);
+ } catch(...) {
+ ctx->catchException();
}
}
return QString();