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/qv4jsonobject.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/qv4jsonobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4jsonobject.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 56e8d1ffe7..ea8afcbaf9 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -702,8 +702,8 @@ QString Stringify::Str(const QString &key, Value value) QString result; if (Object *o = value.asObject()) { - FunctionObject *toJSON = o->get(ctx->engine->newString(QStringLiteral("toJSON"))).asFunctionObject(); - if (toJSON) { + Scoped<FunctionObject> toJSON(scope, o->get(ctx->engine->newString(QStringLiteral("toJSON")))); + if (!!toJSON) { ScopedCallData callData(scope, 1); callData->thisObject = value; callData->args[0] = Value::fromString(ctx, key); @@ -773,6 +773,8 @@ QString Stringify::JO(Object *o) if (stack.contains(o)) ctx->throwTypeError(); + Scope scope(o->engine()); + QString result; stack.push(o); QString stepback = indent; @@ -795,7 +797,7 @@ QString Stringify::JO(Object *o) } else { for (int i = 0; i < propertyList.size(); ++i) { bool exists; - Value v = o->get(propertyList.at(i), &exists); + ScopedValue v(scope, o->get(propertyList.at(i), &exists)); if (!exists) continue; QString member = makeMember(propertyList.at(i)->toQString(), v); |