From 33c13efd91954fb50019e82f3ab8e8e1d8458332 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 5 Nov 2018 10:18:53 +0100 Subject: Ensure our builtin constructors are subclassable Respect the newTarget passed into those constructors and make sure we set up the proto chain correctly. Change-Id: I3d12c7dbef4b33660a6715d73e9fb0f89105167a Fixes: QTBUG-71138 Reviewed-by: Erik Verbruggen --- src/qml/jsruntime/qv4object_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qml/jsruntime/qv4object_p.h') diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 6753ebfcd4..ff47810994 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -373,6 +373,8 @@ public: bool isArray() const; const FunctionObject *speciesConstructor(Scope &scope, const FunctionObject *defaultConstructor) const; + bool setProtoFromNewTarget(const Value *newTarget); + protected: static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver,bool *hasProperty); static bool virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver); -- cgit v1.2.3