diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-07-06 13:04:53 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-11 01:49:59 +0200 |
commit | a1a2c81d7fd5512b8c0531b01453656fc4c96bed (patch) | |
tree | 519b6c02482c3487d64a060041e95ae09a878c49 /src/qml/qml/qqmltypeloader_p.h | |
parent | f5cb65b35e076facbce45e896902a34da7036135 (diff) |
Improved error messages for malformed .import statements
Report errors in .import statements, rather than pass them through
to V8 to yield 'Syntax error'.
Task-number: QTBUG-24867
Change-Id: I111b3bd3d198e97f42b29591f61753e86295aeb2
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmltypeloader_p.h')
-rw-r--r-- | src/qml/qml/qqmltypeloader_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h index b16421a8ee..c05b437f57 100644 --- a/src/qml/qml/qqmltypeloader_p.h +++ b/src/qml/qml/qqmltypeloader_p.h @@ -437,6 +437,10 @@ public: bool isInitialized() const { return hasEngine(); } void initialize(QQmlEngine *); + bool hasError() const { return m_error.isValid(); } + void setError(const QQmlError &error) { m_error = error; } + QQmlError error() const { return m_error; } + protected: virtual void clear(); // From QQmlCleanup @@ -448,6 +452,7 @@ private: QByteArray m_programSource; v8::Persistent<v8::Script> m_program; v8::Persistent<v8::Object> m_value; + QQmlError m_error; }; class Q_AUTOTEST_EXPORT QQmlScriptBlob : public QQmlDataBlob |