aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4functionobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 59d6fdb40a..69c749f92f 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -130,20 +130,18 @@ ReturnedValue FunctionObject::newInstance()
return construct(callData);
}
-bool FunctionObject::hasInstance(Managed *that, const Value &value)
+bool FunctionObject::hasInstance(Managed *that, const ValueRef value)
{
- FunctionObject *f = static_cast<FunctionObject *>(that);
+ Scope scope(that->engine());
+ ScopedFunctionObject f(scope, static_cast<FunctionObject *>(that));
- Object *v = value.asObject();
+ ScopedObject v(scope, value);
if (!v)
return false;
- ExecutionContext *ctx = f->engine()->current;
- QV4::Scope scope(ctx);
-
- Scoped<Object> o(scope, f->get(ctx->engine->id_prototype));
+ Scoped<Object> o(scope, f->get(scope.engine->id_prototype));
if (!o)
- ctx->throwTypeError();
+ scope.engine->current->throwTypeError();
while (v) {
v = v->prototype();
@@ -677,7 +675,7 @@ ReturnedValue BoundFunction::construct(Managed *that, CallData *dd)
return f->target->construct(callData);
}
-bool BoundFunction::hasInstance(Managed *that, const Value &value)
+bool BoundFunction::hasInstance(Managed *that, const ValueRef value)
{
BoundFunction *f = static_cast<BoundFunction *>(that);
return FunctionObject::hasInstance(f->target, value);