diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-12 14:14:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-12 14:14:58 +0100 |
commit | a6a3fa309a9227c9880a667d4277fcb58a9ebd47 (patch) | |
tree | 49831213b6fa926567cfde1728c3bb745d4a726f /src/qml/jsruntime | |
parent | 33201dc147d03690fe8c744654245041c64197e6 (diff) | |
parent | 7c9497a6d47a02d961baef3993ba4cf4267ec607 (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4arrayobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4context.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4context_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 15 |
4 files changed, 12 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 652c0f00ac..efe1dff19c 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -304,7 +304,7 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx) if (!ctx->callData->argc) { ; - } else if (!instance->protoHasArray() && instance->arrayData->length() <= len) { + } else if (!instance->protoHasArray() && instance->arrayData->length() <= len && instance->arrayType() == ArrayData::Simple) { instance->arrayData->vtable()->putArray(instance.getPointer(), len, ctx->callData->args, ctx->callData->argc); len = instance->arrayData->length(); } else { diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 15fea72b25..cec42e87aa 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -71,7 +71,7 @@ CallContext *ExecutionContext::newCallContext(FunctionObject *function, CallData c->lookups = c->compilationUnit->runtimeLookups; } - c->locals = (Value *)(c + 1); + c->locals = (Value *)((quintptr(c + 1) + 7) & ~7); if (function->varCount) std::fill(c->locals, c->locals + function->varCount, Primitive::undefinedValue()); diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index 5904d0b638..f9511d98e3 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -258,7 +258,7 @@ inline Scope::Scope(ExecutionContext *ctx) /* Function *f, int argc */ #define requiredMemoryForExecutionContect(f, argc) \ - sizeof(CallContext) + sizeof(Value) * (f->varCount + qMax((uint)argc, f->formalParameterCount)) + sizeof(CallData) + ((sizeof(CallContext) + 7) & ~7) + sizeof(Value) * (f->varCount + qMax((uint)argc, f->formalParameterCount)) + sizeof(CallData) } // namespace QV4 diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 9bc01d12cc..7f4ac22377 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -317,7 +317,6 @@ ReturnedValue QObjectWrapper::getQmlProperty(ExecutionContext *ctx, QQmlContextD return QV4::Object::get(this, name, hasProperty); } - QQmlData::flushPendingBinding(m_object, result->coreIndex); QQmlData *ddata = QQmlData::get(m_object, false); if (revisionMode == QV4::QObjectWrapper::CheckRevision && result->hasRevision()) { @@ -338,6 +337,8 @@ ReturnedValue QObjectWrapper::getProperty(QObject *object, ExecutionContext *ctx { QV4::Scope scope(ctx); + QQmlData::flushPendingBinding(object, property->coreIndex); + if (property->isFunction() && !property->isVarProperty()) { if (property->isVMEFunction()) { QQmlVMEMetaObject *vmemo = QQmlVMEMetaObject::get(object); @@ -774,11 +775,13 @@ struct QObjectSlotDispatcher : public QtPrivate::QSlotObjectBase } f->call(callData); - if (scope.hasException()) { - QQmlError error = QV4::ExecutionEngine::catchExceptionAsQmlError(ctx); - if (error.description().isEmpty()) - error.setDescription(QString(QLatin1String("Unknown exception occurred during evaluation of connected function: %1")).arg(f->name->toQString())); - QQmlEnginePrivate::get(v4->v8Engine->engine())->warning(error); + if (scope.hasException() && v4->v8Engine) { + if (QQmlEngine *qmlEngine = v4->v8Engine->engine()) { + QQmlError error = QV4::ExecutionEngine::catchExceptionAsQmlError(ctx); + if (error.description().isEmpty()) + error.setDescription(QString(QLatin1String("Unknown exception occurred during evaluation of connected function: %1")).arg(f->name->toQString())); + QQmlEnginePrivate::get(qmlEngine)->warning(error); + } } } break; |