diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-08-30 22:39:23 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-08-31 06:08:55 +0000 |
commit | c56329dfe2518deff61e92ab69c9166c71897167 (patch) | |
tree | 9cc60b3edd6760c72a2d090984bac09c4e9f5384 /src/qml/jsruntime/qv4runtime.cpp | |
parent | 1102cefcd75b250d4b42673b8a606d167cb15048 (diff) |
Throw type error if this is uninitialized when accessing super
Change-Id: I028e198d46a2ec1c55f5dd4cce8dd868ed3e8202
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 8064e64e93..3a1dabeae3 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -877,6 +877,11 @@ ReturnedValue Runtime::method_loadName(ExecutionEngine *engine, int nameIndex) static Object *getSuperBase(Scope &scope) { + if (scope.engine->currentStackFrame->jsFrame->thisObject.isEmpty()) { + scope.engine->throwReferenceError(QStringLiteral("Missing call to super()."), QString(), 0, 0); + return nullptr; + } + ScopedFunctionObject f(scope, scope.engine->currentStackFrame->jsFrame->function); MemberFunction *m = f->as<MemberFunction>(); if (!m) { |