aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypecompiler.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-07-04 13:18:55 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-07-04 16:03:36 +0200
commit40ded579bd977dc8fc41aaa1cdfca36822d14fc6 (patch)
tree04069b8c15c05b2625dd45c869b45c37a6c62b3a /src/qml/qml/qqmltypecompiler.cpp
parentc1546f8b7005a7cc0ed25f9dc1c762a9c929a25b (diff)
Simplify codegen error handling
There can only ever be one error, either a syntax error or a reference error. We record the error type as we want to get rid of the virtual throw<X>Error methods in favor of an explicit compilation result. Change-Id: Ie228490aad8efb7885083f6485f931299567f54c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypecompiler.cpp')
-rw-r--r--src/qml/qml/qqmltypecompiler.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/qml/qml/qqmltypecompiler.cpp b/src/qml/qml/qqmltypecompiler.cpp
index cd2b8742b6..6cbe81b4b8 100644
--- a/src/qml/qml/qqmltypecompiler.cpp
+++ b/src/qml/qml/qqmltypecompiler.cpp
@@ -1356,10 +1356,8 @@ bool QQmlJSCodeGenerator::compileJavaScriptCodeInObjectsRecursively(int objectIn
for (QmlIR::CompiledFunctionOrExpression *foe = object->functionsAndExpressions->first; foe; foe = foe->next)
functionsToCompile << *foe;
const QVector<int> runtimeFunctionIndices = v4CodeGen->generateJSCodeForFunctionsAndBindings(functionsToCompile);
- const auto jsErrors = v4CodeGen->errors();
- if (!jsErrors.isEmpty()) {
- for (const auto &jsError : jsErrors)
- compiler->recordError(jsError);
+ if (v4CodeGen->hasError()) {
+ compiler->recordError(v4CodeGen->error());
return false;
}