aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-06-25 14:58:51 +0200
committerLars Knoll <lars.knoll@qt.io>2018-07-03 08:08:31 +0000
commit2aabdd187aae8a953cfcebac8f6c1ba7b19a0727 (patch)
tree832ef17f2f6433240ec4d329421d119276152792 /src/qml/jsruntime/qv4object.cpp
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r--src/qml/jsruntime/qv4object.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index a59d278f7d..5481b36aa2 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -144,7 +144,7 @@ void Object::defineDefaultProperty(const QString &name, const Value &value, Prop
defineDefaultProperty(s, value, attributes);
}
-void Object::defineDefaultProperty(const QString &name, jsCallFunction code,
+void Object::defineDefaultProperty(const QString &name, VTable::Call code,
int argumentCount, PropertyAttributes attributes)
{
ExecutionEngine *e = engine();
@@ -154,7 +154,7 @@ void Object::defineDefaultProperty(const QString &name, jsCallFunction code,
defineDefaultProperty(s, function, attributes);
}
-void Object::defineDefaultProperty(StringOrSymbol *nameOrSymbol, jsCallFunction code,
+void Object::defineDefaultProperty(StringOrSymbol *nameOrSymbol, VTable::Call code,
int argumentCount, PropertyAttributes attributes)
{
ExecutionEngine *e = engine();
@@ -163,7 +163,7 @@ void Object::defineDefaultProperty(StringOrSymbol *nameOrSymbol, jsCallFunction
defineDefaultProperty(nameOrSymbol, function, attributes);
}
-void Object::defineAccessorProperty(const QString &name, jsCallFunction getter, jsCallFunction setter)
+void Object::defineAccessorProperty(const QString &name, VTable::Call getter, VTable::Call setter)
{
ExecutionEngine *e = engine();
Scope scope(e);
@@ -171,7 +171,7 @@ void Object::defineAccessorProperty(const QString &name, jsCallFunction getter,
defineAccessorProperty(s, getter, setter);
}
-void Object::defineAccessorProperty(StringOrSymbol *name, jsCallFunction getter, jsCallFunction setter)
+void Object::defineAccessorProperty(StringOrSymbol *name, VTable::Call getter, VTable::Call setter)
{
ExecutionEngine *v4 = engine();
QV4::Scope scope(v4);
@@ -892,8 +892,7 @@ bool Object::setPrototypeOf(Managed *m, const Object *proto)
while (p) {
if (p == o->d())
return false;
- if (reinterpret_cast<const ObjectVTable *>(p->vtable())->getPrototypeOf !=
- reinterpret_cast<const ObjectVTable *>(Object::staticVTable())->getPrototypeOf)
+ if (p->vtable()->getPrototypeOf != Object::staticVTable()->getPrototypeOf)
break;
p = p->prototype();
}