diff options
Diffstat (limited to 'src/qml/jsapi')
-rw-r--r-- | src/qml/jsapi/qjsengine.cpp | 5 | ||||
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 49 | ||||
-rw-r--r-- | src/qml/jsapi/qjsvalueiterator.cpp | 4 |
3 files changed, 26 insertions, 32 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index 57647a49d3..d42cabd81c 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -269,9 +269,8 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in script.inheritContext = true; script.parse(); result = script.run(); - } catch (QV4::Exception& ex) { - ex.accept(ctx); - result = ex.value(); + } catch (...) { + result = ctx->catchException(); } return new QJSValuePrivate(d->m_v4Engine, result); } diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index 8bcdccc507..ba94afadc6 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -380,8 +380,8 @@ double QJSValue::toNumber() const QV4::ExecutionContext *ctx = d->engine ? d->engine->current : 0; try { return d->value.toNumber(); - } catch (Exception &e) { - e.accept(ctx); + } catch (...) { + ctx->catchException(); return 0; } } @@ -403,8 +403,8 @@ bool QJSValue::toBool() const QV4::ExecutionContext *ctx = d->engine ? d->engine->current : 0; try { return d->value.toBoolean(); - } catch (Exception &e) { - e.accept(ctx); + } catch (...) { + ctx->catchException(); return false; } } @@ -426,8 +426,8 @@ qint32 QJSValue::toInt() const QV4::ExecutionContext *ctx = d->engine ? d->engine->current : 0; try { return d->value.toInt32(); - } catch (Exception &e) { - e.accept(ctx); + } catch (...) { + ctx->catchException(); return 0; } } @@ -449,8 +449,8 @@ quint32 QJSValue::toUInt() const QV4::ExecutionContext *ctx = d->engine ? d->engine->current : 0; try { return d->value.toUInt32(); - } catch (Exception &e) { - e.accept(ctx); + } catch (...) { + ctx->catchException(); return 0; } } @@ -521,9 +521,8 @@ QJSValue QJSValue::call(const QJSValueList &args) QV4::ExecutionContext *ctx = engine->current; try { result = f->call(callData); - } catch (Exception &e) { - e.accept(ctx); - result = e.value(); + } catch (...) { + result = ctx->catchException(); } return new QJSValuePrivate(engine, result); @@ -578,9 +577,8 @@ QJSValue QJSValue::callWithInstance(const QJSValue &instance, const QJSValueList QV4::ExecutionContext *ctx = engine->current; try { result = f->call(callData); - } catch (Exception &e) { - e.accept(ctx); - result = e.value(); + } catch (...) { + result = ctx->catchException(); } return new QJSValuePrivate(engine, result); @@ -627,9 +625,8 @@ QJSValue QJSValue::callAsConstructor(const QJSValueList &args) QV4::ExecutionContext *ctx = engine->current; try { result = f->construct(callData); - } catch (Exception &e) { - e.accept(ctx); - result = e.value(); + } catch (...) { + result = ctx->catchException(); } return new QJSValuePrivate(engine, result); @@ -819,9 +816,8 @@ QJSValue QJSValue::property(const QString& name) const QV4::ScopedValue result(scope); try { result = o->get(s); - } catch (QV4::Exception &e) { - e.accept(ctx); - result = e.value(); + } catch (...) { + result = ctx->catchException(); } return new QJSValuePrivate(engine, result); } @@ -853,9 +849,8 @@ QJSValue QJSValue::property(quint32 arrayIndex) const QV4::ScopedValue result(scope); try { result = arrayIndex == UINT_MAX ? o->get(engine->id_uintMax) : o->getIndexed(arrayIndex); - } catch (QV4::Exception &e) { - e.accept(ctx); - result = e.value(); + } catch (...) { + result = ctx->catchException(); } return new QJSValuePrivate(engine, result); } @@ -899,8 +894,8 @@ void QJSValue::setProperty(const QString& name, const QJSValue& value) try { QV4::ScopedValue v(scope, value.d->getValue(engine)); o->put(s, v); - } catch (QV4::Exception &e) { - e.accept(ctx); + } catch (...) { + ctx->catchException(); } } @@ -934,8 +929,8 @@ void QJSValue::setProperty(quint32 arrayIndex, const QJSValue& value) o->putIndexed(arrayIndex, v); else o->put(engine->id_uintMax, v); - } catch (QV4::Exception &e) { - e.accept(ctx); + } catch (...) { + ctx->catchException(); } } diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp index e1786f06cd..fd5f709e14 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -211,8 +211,8 @@ QJSValue QJSValueIterator::value() const return QJSValue(); } return new QJSValuePrivate(engine, v); - } catch (QV4::Exception &e) { - e.accept(ctx); + } catch (...) { + ctx->catchException(); return QJSValue(); } } |