path: root/src/qml/jsruntime/qv4object_p.h
diff options
authorLars Knoll <>2018-06-25 14:58:51 +0200
committerLars Knoll <>2018-07-03 08:08:31 +0000
commit2aabdd187aae8a953cfcebac8f6c1ba7b19a0727 (patch)
tree832ef17f2f6433240ec4d329421d119276152792 /src/qml/jsruntime/qv4object_p.h
parent12d8b8c9e4ff05707df7bda479e69d997799c486 (diff)
Unify the managed and object vtables
Allow for nullptr entries in the vtable. To nevertheless get some decent error checking if one of the methods is reimplemented, use a base class for Managed that contains a full set of the vtable entries all being nullptr's. Change-Id: Ibc53973b539f87331e8e465a6c44436a30acbefd Reviewed-by: Simon Hausmann <>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 272f1dbb9d..56f3c3f881 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -166,7 +166,7 @@ struct Q_QML_EXPORT Object: Managed {
void setProperty(ExecutionEngine *engine, uint index, Value v) const { d()->setProperty(engine, index, v); }
void setProperty(ExecutionEngine *engine, uint index, Heap::Base *b) const { d()->setProperty(engine, index, b); }
- const ObjectVTable *vtable() const { return reinterpret_cast<const ObjectVTable *>(d()->vtable()); }
+ const VTable *vtable() const { return d()->vtable(); }
PropertyAttributes getOwnProperty(PropertyKey id, Property *p = nullptr) {
return vtable()->getOwnProperty(this, id, p);
@@ -199,12 +199,12 @@ struct Q_QML_EXPORT Object: Managed {
insertMember(name, value, attributes);
void defineDefaultProperty(const QString &name, const Value &value, PropertyAttributes attributes = Attr_Data|Attr_NotEnumerable);
- void defineDefaultProperty(const QString &name, jsCallFunction code,
+ void defineDefaultProperty(const QString &name, VTable::Call code,
int argumentCount = 0, PropertyAttributes attributes = Attr_Data|Attr_NotEnumerable);
- void defineDefaultProperty(StringOrSymbol *name, jsCallFunction code,
+ void defineDefaultProperty(StringOrSymbol *name, VTable::Call code,
int argumentCount = 0, PropertyAttributes attributes = Attr_Data|Attr_NotEnumerable);
- void defineAccessorProperty(const QString &name, jsCallFunction getter, jsCallFunction setter);
- void defineAccessorProperty(StringOrSymbol *name, jsCallFunction getter, jsCallFunction setter);
+ void defineAccessorProperty(const QString &name, VTable::Call getter, VTable::Call setter);
+ void defineAccessorProperty(StringOrSymbol *name, VTable::Call getter, VTable::Call setter);
/* Fixed: Writable: false, Enumerable: false, Configurable: false */
void defineReadonlyProperty(const QString &name, const Value &value);
void defineReadonlyProperty(String *name, const Value &value);