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/compiler | |
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/compiler')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 5 | ||||
-rw-r--r-- | src/qml/compiler/qv4codegen_p.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 0f60bdc9f3..43756a6f35 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2577,6 +2577,11 @@ void Codegen::throwReferenceError(const SourceLocation &loc, const QString &deta _errors << error; } +QList<QQmlError> Codegen::errors() const +{ + return _errors; +} + void RuntimeCodegen::throwSyntaxError(const AST::SourceLocation &loc, const QString &detail) { context->throwSyntaxError(detail, _module->fileName, loc.startLine, loc.startColumn); diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h index d03f91b654..ea32b5b349 100644 --- a/src/qml/compiler/qv4codegen_p.h +++ b/src/qml/compiler/qv4codegen_p.h @@ -414,7 +414,8 @@ protected: virtual void throwSyntaxError(const AST::SourceLocation &loc, const QString &detail); virtual void throwReferenceError(const AST::SourceLocation &loc, const QString &detail); - QList<QQmlError> errors(); +public: + QList<QQmlError> errors() const; protected: Result _expr; |