diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 14:36:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:21 +0200 |
commit | 002e6105f61269f1474de878ccdb26205e5b226e (patch) | |
tree | ead1d10b7d8aa2537e7073327d9d0d9ce591c995 /src/qml/jsruntime/qv4lookup.cpp | |
parent | 1a2a83f80ba4ecc28eba72af57c81bd43a45946c (diff) |
Require a ValueScope for ScopedCallData as well
This brings things more in line with ScopedValue, and
also simplifies cleanup of Scoped values.
Change-Id: If5f1466b4e13c629d56c1e7c638937f61ba48f77
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4lookup.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4lookup.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index b630bbed5b..6ad617c4d6 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -198,12 +198,13 @@ void Lookup::getterAccessor0(Lookup *l, Value *result, const Value &object) { if (Object *o = object.asObject()) { if (l->classList[0] == o->internalClass) { + ValueScope scope(o->engine()); Value res; FunctionObject *getter = o->memberData[l->index].getter(); if (!getter) { res = Value::undefinedValue(); } else { - ScopedCallData callData(o->engine(), 0); + ScopedCallData callData(scope, 0); callData->thisObject = object; res = Value::fromReturnedValue(getter->call(callData)); } @@ -221,12 +222,13 @@ void Lookup::getterAccessor1(Lookup *l, Value *result, const Value &object) if (Object *o = object.asObject()) { if (l->classList[0] == o->internalClass && l->classList[1] == o->prototype()->internalClass) { + ValueScope scope(o->engine()); Value res; FunctionObject *getter = o->prototype()->memberData[l->index].getter(); if (!getter) { res = Value::undefinedValue(); } else { - ScopedCallData callData(o->engine(), 0); + ScopedCallData callData(scope, 0); callData->thisObject = object; res = Value::fromReturnedValue(getter->call(callData)); } @@ -247,12 +249,13 @@ void Lookup::getterAccessor2(Lookup *l, Value *result, const Value &object) if (l->classList[1] == o->internalClass) { o = o->prototype(); if (l->classList[2] == o->internalClass) { + ValueScope scope(o->engine()); Value res; FunctionObject *getter = o->memberData[l->index].getter(); if (!getter) { res = Value::undefinedValue(); } else { - ScopedCallData callData(o->engine(), 0); + ScopedCallData callData(scope, 0); callData->thisObject = object; res = Value::fromReturnedValue(getter->call(callData)); } @@ -302,12 +305,13 @@ void Lookup::primitiveGetterAccessor0(Lookup *l, Value *result, const Value &obj if (object.type() == l->type) { Object *o = l->proto; if (l->classList[0] == o->internalClass) { + ValueScope scope(o->engine()); Value res; FunctionObject *getter = o->memberData[l->index].getter(); if (!getter) { res = Value::undefinedValue(); } else { - ScopedCallData callData(o->engine(), 0); + ScopedCallData callData(scope, 0); callData->thisObject = object; res = Value::fromReturnedValue(getter->call(callData)); } @@ -326,12 +330,13 @@ void Lookup::primitiveGetterAccessor1(Lookup *l, Value *result, const Value &obj Object *o = l->proto; if (l->classList[0] == o->internalClass && l->classList[1] == o->prototype()->internalClass) { + ValueScope scope(o->engine()); Value res; FunctionObject *getter = o->prototype()->memberData[l->index].getter(); if (!getter) { res = Value::undefinedValue(); } else { - ScopedCallData callData(o->engine(), 0); + ScopedCallData callData(scope, 0); callData->thisObject = object; res = Value::fromReturnedValue(getter->call(callData)); } @@ -431,11 +436,12 @@ void Lookup::globalGetterAccessor0(Lookup *l, ExecutionContext *ctx, Value *resu { Object *o = ctx->engine->globalObject; if (l->classList[0] == o->internalClass) { + ValueScope scope(o->engine()); FunctionObject *getter = o->memberData[l->index].getter(); if (!getter) { *result = Value::undefinedValue(); } else { - ScopedCallData callData(ctx->engine, 0); + ScopedCallData callData(scope, 0); callData->thisObject = Value::undefinedValue(); *result = Value::fromReturnedValue(getter->call(callData)); } @@ -450,11 +456,12 @@ void Lookup::globalGetterAccessor1(Lookup *l, ExecutionContext *ctx, Value *resu Object *o = ctx->engine->globalObject; if (l->classList[0] == o->internalClass && l->classList[1] == o->prototype()->internalClass) { + ValueScope scope(o->engine()); FunctionObject *getter = o->prototype()->memberData[l->index].getter(); if (!getter) { *result = Value::undefinedValue(); } else { - ScopedCallData callData(ctx->engine, 0); + ScopedCallData callData(scope, 0); callData->thisObject = Value::undefinedValue(); *result = Value::fromReturnedValue(getter->call(callData)); } @@ -472,11 +479,12 @@ void Lookup::globalGetterAccessor2(Lookup *l, ExecutionContext *ctx, Value *resu if (l->classList[1] == o->internalClass) { o = o->prototype(); if (l->classList[2] == o->internalClass) { + ValueScope scope(o->engine()); FunctionObject *getter = o->memberData[l->index].getter(); if (!getter) { *result = Value::undefinedValue(); } else { - ScopedCallData callData(ctx->engine, 0); + ScopedCallData callData(scope, 0); callData->thisObject = Value::undefinedValue(); *result = Value::fromReturnedValue(getter->call(callData)); } |