aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-19 09:58:50 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-22 01:06:20 +0200
commit383fa29f95a595be4d6f4da113dff3b0dca79343 (patch)
treec0158b37c56df5daa9be9d7222cce229d8afaa96 /src/qml/jsruntime/qv4runtime.cpp
parent332b870bd8f0fba6f09e539376a674d7a4413631 (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/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 63050c7c34..5d899096cf 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -263,13 +263,17 @@ ReturnedValue __qmljs_delete_subscript(ExecutionContext *ctx, const ValueRef bas
ReturnedValue __qmljs_delete_member(ExecutionContext *ctx, const ValueRef base, String *name)
{
- Object *obj = base->toObject(ctx);
- return Value::fromBoolean(obj->deleteProperty(name)).asReturnedValue();
+ Scope scope(ctx);
+ ScopedObject obj(scope, base->toObject(ctx));
+ ScopedString n(scope, name);
+ return Encode(obj->deleteProperty(n));
}
ReturnedValue __qmljs_delete_name(ExecutionContext *ctx, String *name)
{
- return Value::fromBoolean(ctx->deleteProperty(name)).asReturnedValue();
+ Scope scope(ctx);
+ ScopedString n(scope, name);
+ return Encode(ctx->deleteProperty(n));
}
QV4::ReturnedValue __qmljs_add_helper(ExecutionContext *ctx, const ValueRef left, const ValueRef right)
@@ -296,7 +300,7 @@ QV4::ReturnedValue __qmljs_instanceof(ExecutionContext *ctx, const ValueRef left
if (!o)
ctx->throwTypeError();
- bool r = o->hasInstance(*left);
+ bool r = o->hasInstance(left);
return Value::fromBoolean(r).asReturnedValue();
}