diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-30 10:08:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-30 12:16:25 +0100 |
commit | 0a3e9a41b1dbf7635865e3a9788075e11e5fc74b (patch) | |
tree | 3c70df87b181baadc0e8957dd95b9a9dc4b2608c /src/qml/jsruntime/qv4script.cpp | |
parent | 64eadc4aab0880d846067d76b12cc92cf406f3ec (diff) |
Remove the last C++ exceptions from QtQml
Also clean up and compile the repository with exceptions
disabled again.
Change-Id: I653ae89353284b2f4ab884384f8ea6a5d100785d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index a2d89a3278..6e2c26edaf 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -286,27 +286,6 @@ Function *Script::function() return vmFunction; } -struct PrecompilingCodeGen : public QQmlJS::Codegen -{ - struct CompileError {}; - - PrecompilingCodeGen(bool strict) - : QQmlJS::Codegen(strict) - {} - - virtual void throwSyntaxError(const QQmlJS::AST::SourceLocation &loc, const QString &detail) - { - QQmlJS::Codegen::throwSyntaxError(loc, detail); - throw CompileError(); - } - - virtual void throwReferenceError(const QQmlJS::AST::SourceLocation &loc, const QString &detail) - { - QQmlJS::Codegen::throwReferenceError(loc, detail); - throw CompileError(); - } -}; - CompiledData::CompilationUnit *Script::precompile(ExecutionEngine *engine, const QUrl &url, const QString &source, bool parseAsBinding, QList<QQmlError> *reportedErrors) { using namespace QQmlJS; @@ -350,10 +329,10 @@ CompiledData::CompilationUnit *Script::precompile(ExecutionEngine *engine, const return 0; } - PrecompilingCodeGen cg(/*strict mode*/false); - try { - cg.generateFromProgram(url.toString(), source, program, &module, parseAsBinding ? QQmlJS::Codegen::QmlBinding : QQmlJS::Codegen::GlobalCode); - } catch (const PrecompilingCodeGen::CompileError &) { + QQmlJS::Codegen cg(/*strict mode*/false); + cg.generateFromProgram(url.toString(), source, program, &module, parseAsBinding ? QQmlJS::Codegen::QmlBinding : QQmlJS::Codegen::GlobalCode); + errors = cg.errors(); + if (!errors.isEmpty()) { if (reportedErrors) *reportedErrors << cg.errors(); return 0; |