diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 16:28:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:33 +0200 |
commit | bdb27b96acbd38531879378c48959a5a1cd60963 (patch) | |
tree | 056f2c8c35be97a9564dee5d0ea65bed7265b7ce /src/qml/jsruntime/qv4serialize.cpp | |
parent | 8d26084ae56ba5aedd73ab733553dbf9cb3eb672 (diff) |
Use ReturnedValue for Managed::get().
Change-Id: Ia8f35d227b69d32e1f6a041283abbbd083aa34ca
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4serialize.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4serialize.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4serialize.cpp b/src/qml/jsruntime/qv4serialize.cpp index f7389dc6d7..b183baf0c2 100644 --- a/src/qml/jsruntime/qv4serialize.cpp +++ b/src/qml/jsruntime/qv4serialize.cpp @@ -150,6 +150,8 @@ static inline void *popPtr(const char *&data) void Serialize::serialize(QByteArray &data, const QV4::Value &v, QV8Engine *engine) { QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); + QV4::Scope scope(v4); + if (v.isEmpty()) { } else if (v.isUndefined()) { push(data, valueheader(WorkerUndefined)); @@ -240,7 +242,7 @@ void Serialize::serialize(QByteArray &data, const QV4::Value &v, QV8Engine *engi if (o->isListType()) { // valid sequence. we generate a length (sequence length + 1 for the sequence type) - uint32_t seqLength = o->get(v4->id_length).toUInt32(); + uint32_t seqLength = ScopedValue(scope, o->get(v4->id_length))->toUInt32(); uint32_t length = seqLength + 1; if (length > 0xFFFFFF) { push(data, valueheader(WorkerUndefined)); @@ -264,14 +266,13 @@ void Serialize::serialize(QByteArray &data, const QV4::Value &v, QV8Engine *engi } push(data, valueheader(WorkerObject, length)); - QV4::ExecutionEngine *v4 = QV8Engine::getV4(engine); + QV4::ScopedValue val(scope); for (quint32 ii = 0; ii < length; ++ii) { QV4::String *s = properties->getIndexed(ii).asString(); serialize(data, QV4::Value::fromString(s), engine); bool hasCaught = false; QV4::ExecutionContext *ctx = v4->current; - QV4::Value val = QV4::Value::undefinedValue(); try { val = o->get(s); } catch (QV4::Exception &e) { |