aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-11 16:28:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:13:33 +0200
commitbdb27b96acbd38531879378c48959a5a1cd60963 (patch)
tree056f2c8c35be97a9564dee5d0ea65bed7265b7ce /src/qml/jsruntime/qv4runtime.cpp
parent8d26084ae56ba5aedd73ab733553dbf9cb3eb672 (diff)
Use ReturnedValue for Managed::get().
Change-Id: Ia8f35d227b69d32e1f6a041283abbbd083aa34ca Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index a6257958b4..31f477bedd 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -692,7 +692,7 @@ ReturnedValue __qmljs_get_element(ExecutionContext *ctx, const ValueRef object,
}
String *name = index->toString(ctx);
- return o->get(name).asReturnedValue();
+ return o->get(name);
}
void __qmljs_set_element(ExecutionContext *ctx, const ValueRef object, const ValueRef index, const ValueRef value)
@@ -769,7 +769,7 @@ ReturnedValue __qmljs_get_property(ExecutionContext *ctx, const ValueRef object,
Value res;
Managed *m = object->asManaged();
if (m)
- return m->get(name).asReturnedValue();
+ return m->get(name);
if (object->isNullOrUndefined()) {
QString message = QStringLiteral("Cannot read property '%1' of %2").arg(name->toQString()).arg(object->toQStringNoThrow());
@@ -777,7 +777,7 @@ ReturnedValue __qmljs_get_property(ExecutionContext *ctx, const ValueRef object,
}
m = __qmljs_convert_to_object(ctx, object);
- return m->get(name).asReturnedValue();
+ return m->get(name);
}
ReturnedValue __qmljs_get_activation_property(ExecutionContext *ctx, String *name)
@@ -974,6 +974,7 @@ ReturnedValue __qmljs_call_activation_property(ExecutionContext *context, String
ReturnedValue __qmljs_call_property(ExecutionContext *context, String *name, CallDataRef callData)
{
+ Scope scope(context);
Managed *baseObject = callData->thisObject.asManaged();
if (!baseObject) {
if (callData->thisObject.isNullOrUndefined()) {
@@ -985,7 +986,7 @@ ReturnedValue __qmljs_call_property(ExecutionContext *context, String *name, Cal
callData->thisObject = Value::fromObject(static_cast<Object *>(baseObject));
}
- FunctionObject *o = baseObject->get(name).asFunctionObject();
+ Scoped<FunctionObject> o(scope, baseObject->get(name));
if (!o) {
QString error = QString("Property '%1' of object %2 is not a function").arg(name->toQString(), callData->thisObject.toQStringNoThrow());
context->throwTypeError(error);
@@ -1010,10 +1011,11 @@ ReturnedValue __qmljs_call_property_lookup(ExecutionContext *context, uint index
ReturnedValue __qmljs_call_element(ExecutionContext *context, const ValueRef index, CallDataRef callData)
{
+ Scope scope(context);
Object *baseObject = callData->thisObject.toObject(context);
callData->thisObject = Value::fromObject(baseObject);
- Object *o = baseObject->get(index->toString(context)).asObject();
+ Scoped<Object> o(scope, baseObject->get(index->toString(context)));
if (!o)
context->throwTypeError();
@@ -1069,10 +1071,10 @@ ReturnedValue __qmljs_construct_value(ExecutionContext *context, const ValueRef
ReturnedValue __qmljs_construct_property(ExecutionContext *context, const ValueRef base, String *name, CallDataRef callData)
{
+ Scope scope(context);
Object *thisObject = base->toObject(context);
- Value func = thisObject->get(name);
- Object *f = func.asObject();
+ Scoped<Object> f(scope, thisObject->get(name));
if (!f)
context->throwTypeError();