diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-09-29 21:20:09 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-30 18:21:26 +0200 |
commit | c48d727e25f0a07d709a81765af6196bc0ddb4c5 (patch) | |
tree | 1ad34d61bf20e8756d52f44fd17956844a793d84 /src/qml/qml/qqmltypeloader_p.h | |
parent | 2b6dfcf23b8e9d672dff0a083ed4e7adc28115eb (diff) |
Compile imported scripts in the loader thread
This has the benefit of blocking the GUI thread less and speeding up type
creation in the GUI thread (for types that import js libraries).
This patch also brings one behavioral change: Due to the parsing at type
instantiation type, things like syntax errors for script imports would only
generate a run-time warning and the code in the QML file would just see
"undefined". Errors in the script now generate real errors at component
compilation time, meaning the errors come out earlier and as real errors.
This patch implements the separation for the VME only (to keep the size
of this patch small).
Change-Id: I82f7f3a2d3d4524ea12a7ab62abd8640aba6a47f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmltypeloader_p.h')
-rw-r--r-- | src/qml/qml/qqmltypeloader_p.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h index be1ffba09e..f6eea6c248 100644 --- a/src/qml/qml/qqmltypeloader_p.h +++ b/src/qml/qml/qqmltypeloader_p.h @@ -511,10 +511,6 @@ 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 @@ -523,10 +519,9 @@ private: friend class QQmlScriptBlob; bool m_loaded; - QByteArray m_programSource; + QV4::CompiledData::CompilationUnit *m_precompiledScript; QV4::Script *m_program; QV4::PersistentValue m_value; - QQmlError m_error; }; class Q_AUTOTEST_EXPORT QQmlScriptBlob : public QQmlTypeLoader::Blob |