diff options
| author | Lars Knoll <lars.knoll@digia.com> | 2013-11-02 17:11:06 +0100 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-05 22:23:25 +0100 |
| commit | 26db9863f18d7f7e89cec88b720e4fb4c674dd5b (patch) | |
| tree | fe5443f04e6c6adf47ac45e2e46b7c3965faf08a /src/qml/jsruntime/qv4stringobject.cpp | |
| parent | 4ffa7d3f651757b7bc10ae9801b7802a8f2e260f (diff) | |
Optimise string additions
Small optimisation for string additions, also add one more check
for exceptions in the code where required.
Change-Id: I6c14bc88ea5d03f7eeed0e0168c5195f9f823693
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4stringobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4stringobject.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index 33dd403e9b..7ba7a38cc0 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -301,8 +301,10 @@ ReturnedValue StringPrototype::method_concat(SimpleCallContext *context) ScopedValue v(scope); for (int i = 0; i < context->callData->argc; ++i) { - v = __qmljs_to_string(ValueRef(&context->callData->args[i]), context); - assert(v->isString()); + v = __qmljs_to_string(context, ValueRef(&context->callData->args[i])); + if (scope.hasException()) + return Encode::undefined(); + Q_ASSERT(v->isString()); value += v->stringValue()->toQString(); } |
