aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r--src/qml/jsruntime/qv4object.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index 72f9f84bb2..eb4e392c0f 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -308,16 +308,6 @@ PropertyIndex Object::getValueOrSetter(PropertyKey id, PropertyAttributes *attrs
return { nullptr, nullptr };
}
-ReturnedValue Object::virtualCallAsConstructor(const FunctionObject *f, const Value *, int, const Value *)
-{
- return f->engine()->throwTypeError();
-}
-
-ReturnedValue Object::virtualCall(const FunctionObject *f, const Value *, const Value *, int)
-{
- return f->engine()->throwTypeError();
-}
-
ReturnedValue Object::virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)
{
if (id.isArrayIndex())
@@ -973,11 +963,13 @@ const FunctionObject *Object::speciesConstructor(Scope &scope, const FunctionObj
ScopedValue S(scope, c->get(scope.engine->symbol_species()));
if (S->isNullOrUndefined())
return defaultConstructor;
- if (!S->isFunctionObject()) {
+ const FunctionObject *f = S->as<FunctionObject>();
+ if (!f || !f->isConstructor()) {
scope.engine->throwTypeError();
return nullptr;
}
- return static_cast<const FunctionObject *>(S.ptr);
+ Q_ASSERT(f->isFunctionObject());
+ return static_cast<const FunctionObject *>(f);
}