diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 22:45:47 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:38 +0200 |
commit | 2187beaaae09d3cf279f50d1f606ef6077250bfe (patch) | |
tree | c9f175d7ef98a8c94cf4f16fd57bf1b3edd512a7 /src/qml/jsruntime/qv4runtime.cpp | |
parent | 6c9f1c8ed93374c16ca6ac540f39e98b451be0d8 (diff) |
Convert lookups to use ReturnedValue
Change-Id: Idbcd1fbd2aa43775ce8c1a3d8fac29a6b58b678a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 107ae695a8..e17d9b833d 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -930,17 +930,16 @@ QV4::Bool __qmljs_cmp_le(const QV4::ValueRef l, const QV4::ValueRef r) ReturnedValue __qmljs_call_global_lookup(ExecutionContext *context, uint index, CallDataRef callData) { + Scope scope(context); Q_ASSERT(callData->thisObject.isUndefined()); Lookup *l = context->lookups + index; - Value v; - l->globalGetter(l, context, &v); - FunctionObject *o = v.asFunctionObject(); + Scoped<FunctionObject> o(scope, l->globalGetter(l, context)); if (!o) context->throwTypeError(); - if (o == context->engine->evalFunction && l->name->isEqualTo(context->engine->id_eval)) - return static_cast<EvalFunction *>(o)->evalCall(callData->thisObject, callData->args, callData->argc, true); + if (o.getPointer() == context->engine->evalFunction && l->name->isEqualTo(context->engine->id_eval)) + return static_cast<EvalFunction *>(o.getPointer())->evalCall(callData->thisObject, callData->args, callData->argc, true); return o->call(callData); } @@ -997,12 +996,10 @@ ReturnedValue __qmljs_call_property(ExecutionContext *context, String *name, Cal ReturnedValue __qmljs_call_property_lookup(ExecutionContext *context, uint index, CallDataRef callData) { - Value func; + Scope scope(context); Lookup *l = context->lookups + index; - l->getter(l, &func, callData->thisObject); - - Object *o = func.asObject(); + Scoped<Object> o(scope, l->getter(l, callData->thisObject)); if (!o) context->throwTypeError(); @@ -1034,14 +1031,11 @@ ReturnedValue __qmljs_call_value(ExecutionContext *context, const ValueRef func, ReturnedValue __qmljs_construct_global_lookup(ExecutionContext *context, uint index, CallDataRef callData) { + Scope scope(context); Q_ASSERT(callData->thisObject.isUndefined()); - Value func; - Lookup *l = context->lookups + index; - l->globalGetter(l, context, &func); - - Object *f = func.asObject(); + Scoped<Object> f(scope, l->globalGetter(l, context)); if (!f) context->throwTypeError(); |