diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-05-20 20:27:16 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-21 10:05:22 +0200 |
commit | b7d79a0c271c9541c96be4028ee76eb304e06bf5 (patch) | |
tree | 5931c074dc6537e874bc87f9b60151a52390367d /src/qml/qml/qqmljavascriptexpression_p.h | |
parent | d0d9e6458f1ce90ca4985d7cf03e7bfae48d664a (diff) |
Cleanup QQmlDelayedError
Remove dependency onto v8::Message and simplify conversion from
QV4::Exception to QQmlError.
Change-Id: Icfdfd7a2749210b2df9fda6cd5de94114b8adcfa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression_p.h')
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression_p.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h index b9ce49592a..9888812093 100644 --- a/src/qml/qml/qqmljavascriptexpression_p.h +++ b/src/qml/qml/qqmljavascriptexpression_p.h @@ -77,19 +77,18 @@ public: prevError = 0; } - inline bool isValid() const { return !!m_message || m_error.isValid(); } - inline const QQmlError &error(QQmlEngine *engine) const { convertMessageToError(engine); return m_error; } - inline void clearError() { m_message.reset(); m_error = QQmlError(); } + inline bool isValid() const { return m_error.isValid(); } + inline const QQmlError &error() const { return m_error; } + inline void clearError() { m_error = QQmlError(); } - void setMessage(v8::Handle<v8::Message> message); void setErrorLocation(const QUrl &url, quint16 line, quint16 column); void setErrorDescription(const QString &description); + void setError(const QV4::Exception &e); + private: - void convertMessageToError(QQmlEngine *engine) const; mutable QQmlError m_error; - mutable QExplicitlySharedDataPointer<v8::Message> m_message; QQmlDelayedError *nextError; QQmlDelayedError **prevError; @@ -147,6 +146,7 @@ public: void clearGuards(); QQmlDelayedError *delayedError(); + static void exceptionToError(const QV4::Exception &e, QQmlError &); static void exceptionToError(v8::Handle<v8::Message>, QQmlError &); static QV4::PersistentValue evalFunction(QQmlContextData *ctxt, QObject *scope, const QString &code, const QString &filename, |