aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-08-18 15:26:45 +0200
committerLars Knoll <lars.knoll@qt.io>2018-08-23 19:18:15 +0000
commitf15cc9f1df8e17f049c111e3147d6c63c07eb756 (patch)
treeae4daaa5e1cde31c0e412b84e9521f3745911657 /src/qml/jit
parent6e2fc84646987135c96755fbe1c2af20fc722e3d (diff)
Implement IsConstructor for Function objects
Use the jsConstruct member in the function object for this and set it to a nullptr for methods that are not a constructor. Change-Id: I63d2971b23b2596a8e3b6d2781f0d9ed3208693b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r--src/qml/jit/qv4jithelpers.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jit/qv4jithelpers.cpp b/src/qml/jit/qv4jithelpers.cpp
index 23e3095a85..9e057dd33d 100644
--- a/src/qml/jit/qv4jithelpers.cpp
+++ b/src/qml/jit/qv4jithelpers.cpp
@@ -42,6 +42,7 @@
#include "qv4function_p.h"
#include "qv4value_p.h"
#include "qv4object_p.h"
+#include "qv4functionobject_p.h"
#include "qv4lookup_p.h"
#include <QtCore/private/qnumeric_p.h>
@@ -71,7 +72,8 @@ ReturnedValue loadGlobalLookup(ExecutionEngine *engine, Function *f, int index)
ReturnedValue loadSuperConstructor(ExecutionEngine *engine, const Value *t)
{
- if (!t->isObject()) {
+ const FunctionObject *f = t->as<FunctionObject>();
+ if (!f || !f->isConstructor()) {
engine->throwTypeError();
return Encode::undefined();
}