diff options
| author | Lars Knoll <lars.knoll@digia.com> | 2013-09-19 09:58:50 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
| commit | 383fa29f95a595be4d6f4da113dff3b0dca79343 (patch) | |
| tree | c0158b37c56df5daa9be9d7222cce229d8afaa96 /src/qml/jsruntime/qv4functionobject.cpp | |
| parent | 332b870bd8f0fba6f09e539376a674d7a4413631 (diff) | |
Convert the remaining vtable methods to be GC safe
Change-Id: I679d1833609c41d71e8436ec0ba8a4624f0c4dd0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 16 |
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); |
