diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-17 08:56:51 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-19 14:59:11 +0200 |
commit | 9fd4591a61df467362fa2f17cc2d506efd6bece3 (patch) | |
tree | fa3c31cffcd67943ae26823ab9d2b8370815980f /src/qml/qml | |
parent | f0eaaef4aeb6fa8951cca1e1e90def3411896e9f (diff) |
Remove internal method from public API
QQmlError is public API and shouldn't expose an internal
method.
Change-Id: I7caf06af9340fefec5c96103395fe74acbf19497
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlerror.cpp | 22 | ||||
-rw-r--r-- | src/qml/qml/qqmlerror.h | 7 | ||||
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 2 |
7 files changed, 7 insertions, 36 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 6d194a6ba8..ab08fb78e3 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1573,7 +1573,7 @@ void QmlIncubatorObject::statusChanged(QQmlIncubator::Status s) callData->args[0] = QV4::Primitive::fromUInt32(s); f->call(callData); } catch (...) { - QQmlError error = QQmlError::catchJavaScriptException(ctx); + QQmlError error = QV4::ExecutionEngine::convertJavaScriptException(ctx); QQmlEnginePrivate::warning(QQmlEnginePrivate::get(v8->engine()), error); } } diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qml/qqmlerror.cpp index 3a4179717a..ad95ecdf06 100644 --- a/src/qml/qml/qqmlerror.cpp +++ b/src/qml/qml/qqmlerror.cpp @@ -138,28 +138,6 @@ QQmlError::~QQmlError() delete d; d = 0; } -QQmlError QQmlError::catchJavaScriptException(QV4::ExecutionContext *context) -{ - QV4::StackTrace trace; - QV4::Scope scope(context); - QV4::ScopedValue exception(scope, context->catchException(&trace)); - QQmlError error; - if (!trace.isEmpty()) { - QV4::StackFrame frame = trace.first(); - error.setUrl(QUrl(frame.source)); - error.setLine(frame.line); - error.setColumn(frame.column); - } - QV4::Scoped<QV4::ErrorObject> errorObj(scope, exception); - if (!!errorObj && errorObj->asSyntaxError()) { - QV4::ScopedString m(scope, errorObj->engine()->newString("message")); - QV4::ScopedValue v(scope, errorObj->get(m)); - error.setDescription(v->toQStringNoThrow()); - } else - error.setDescription(exception->toQStringNoThrow()); - return error; -} - /*! Returns true if this error is valid, otherwise false. */ diff --git a/src/qml/qml/qqmlerror.h b/src/qml/qml/qqmlerror.h index 50491b911c..e69b3c15ba 100644 --- a/src/qml/qml/qqmlerror.h +++ b/src/qml/qml/qqmlerror.h @@ -49,10 +49,6 @@ QT_BEGIN_NAMESPACE -namespace QV4 { -struct ExecutionContext; -} - class QDebug; class QQmlErrorPrivate; class Q_QML_EXPORT QQmlError @@ -63,9 +59,6 @@ public: QQmlError &operator=(const QQmlError &); ~QQmlError(); - // Use only inside catch(...) -- will re-throw if no JS exception - static QQmlError catchJavaScriptException(QV4::ExecutionContext *context); - bool isValid() const; QUrl url() const; diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 8751d9c500..37a9e398f8 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -86,7 +86,7 @@ void QQmlDelayedError::setErrorObject(QObject *object) void QQmlDelayedError::catchJavaScriptException(QV4::ExecutionContext *context) { - m_error = QQmlError::catchJavaScriptException(context); + m_error = QV4::ExecutionEngine::convertJavaScriptException(context); } @@ -306,7 +306,7 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObje script.parse(); result = script.run(); } catch (...) { - QQmlError error = QQmlError::catchJavaScriptException(ctx); + QQmlError error = QV4::ExecutionEngine::convertJavaScriptException(ctx); if (error.description().isEmpty()) error.setDescription(QLatin1String("Exception occurred during function evaluation")); if (error.line() == -1) @@ -340,7 +340,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::qmlBinding(QQmlContextData *ctxt, Q script.parse(); result = script.qmlBinding(); } catch (...) { - QQmlError error = QQmlError::catchJavaScriptException(ctx); + QQmlError error = QV4::ExecutionEngine::convertJavaScriptException(ctx); if (error.description().isEmpty()) error.setDescription(QLatin1String("Exception occurred during function evaluation")); if (error.line() == -1) diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 5f733caf51..932faf4b88 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -2767,7 +2767,7 @@ QV4::PersistentValue QQmlScriptData::scriptValueForContext(QQmlContextData *pare m_program->qml = qmlglobal; m_program->run(); } catch (...) { - QQmlError error = QQmlError::catchJavaScriptException(ctx); + QQmlError error = QV4::ExecutionEngine::convertJavaScriptException(ctx); if (error.isValid()) ep->warning(error); } diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index 915314e322..5752033744 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -960,7 +960,7 @@ int QQmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) result = function->call(callData); if (a[0]) *(QVariant *)a[0] = ep->v8engine()->toVariant(result, 0); } catch (...) { - QQmlError error = QQmlError::catchJavaScriptException(ctx); + QQmlError error = QV4::ExecutionEngine::convertJavaScriptException(ctx); if (error.isValid()) ep->warning(error); if (a[0]) *(QVariant *)a[0] = QVariant(); diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 7a251601db..aff0cf2b59 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -1572,7 +1572,7 @@ void QQmlXMLHttpRequest::dispatchCallback(const ValueRef me) // the source is changed). We do nothing in this case, as the evaluation // cannot succeed. } catch (...) { - QQmlError error = QQmlError::catchJavaScriptException(ctx); + QQmlError error = QV4::ExecutionEngine::convertJavaScriptException(ctx); QQmlEnginePrivate::warning(QQmlEnginePrivate::get(v4->v8Engine->engine()), error); } } |