diff options
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 82e1284289..9180108a0c 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1550,8 +1550,9 @@ ReturnedValue Runtime::method_createClass(ExecutionEngine *engine, int classInde if (superClass.isNull()) { protoParent = Encode::null(); } else { + const FunctionObject *superFunction = superClass.as<FunctionObject>(); // ### check that the heritage object is a constructor - if (!superClass.isFunctionObject()) + if (!superFunction || !superFunction->isConstructor()) return engine->throwTypeError(QStringLiteral("The superclass is not a function object.")); const FunctionObject *s = static_cast<const FunctionObject *>(&superClass); ScopedValue result(scope, s->get(scope.engine->id_prototype())); |