diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-21 09:50:27 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-29 10:38:55 +0100 |
commit | e0284ab41f7a1889f28e719212df66e942959f4c (patch) | |
tree | dfbd27e96968c07d49372c6ed06f0b51f2c6c8b8 /src/qml/jsruntime/qv4globalobject.cpp | |
parent | 59cc901d3d15079b3666e5902b4c8b1a83ff1fd2 (diff) |
Properly propagate parse errors
Replace all try/catch statements used when parsing
with checks for engine->hasException.
Change-Id: I4493cb600d5a3eb095c2003bb88bd031403e47c9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4globalobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4globalobject.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index 4dcdb08415..d95ab9791f 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -400,6 +400,8 @@ ReturnedValue EvalFunction::evalCall(CallData *callData, bool directCall) script.strictMode = (directCall && parentContext->strictMode); script.inheritContext = inheritContext; script.parse(); + if (scope.engine->hasException) + return Encode::undefined(); Function *function = script.function(); if (!function) |