From f15cc9f1df8e17f049c111e3147d6c63c07eb756 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 18 Aug 2018 15:26:45 +0200 Subject: 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 --- src/qml/jit/qv4jithelpers.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qml/jit/qv4jithelpers.cpp') 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 @@ -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(); + if (!f || !f->isConstructor()) { engine->throwTypeError(); return Encode::undefined(); } -- cgit v1.2.3