diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-16 22:02:27 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | e441692b0b8f8fffdfdfa8a21c570adcd5cbae7a (patch) | |
tree | 9b764401d87682012328c46dc947721f47b428b2 /src/qml/jsruntime/qv4object_p.h | |
parent | a0f8be4021caa9bb5055923f0eea3bee0e345235 (diff) |
Further work towards an exact GC
Add some more convenience in the helper classes
in qscopedvalue_p.h
Make accesses to CallData safer, and change
ExecutionEngine::newObject() to return a safe
pointer.
Change-Id: I980909754ce9681cf6faa1355bab3a1e5d6dd186
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4object_p.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 7cb3fe45c2..83c7d864ff 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -178,10 +178,6 @@ struct Q_QML_EXPORT Object: Managed { inline ExecutionEngine *engine() const { return internalClass->engine; } - static Object *cast(const Value &v) { - return v.asObject(); - } - // Array handling uint allocArrayValue() { @@ -464,6 +460,17 @@ inline void Object::arraySet(uint index, const Property *pd) *arrayInsert(index) = *pd; } +template<> +inline Object *value_cast(const Value &v) { + return v.asObject(); +} + +template<> +inline ReturnedValue value_convert<Object>(ExecutionContext *ctx, const Value &v) +{ + return v.toObject(ctx)->asReturnedValue(); +} + } QT_END_NAMESPACE |