From 16032db6cd22f7d429011c8d0fbaf275c87f9ab5 Mon Sep 17 00:00:00 2001 From: Evan Welsh Date: Sun, 12 Sep 2021 00:26:06 -0700 Subject: Correctly chain constructor prototypes to enable static inheritance In ES2015+ classes it is expected for constructors to inherit the static methods of their parent class, our implementation of classes previously did not do this as it was uncommon in ES5 era classes. --- gi/object.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gi/object.h') diff --git a/gi/object.h b/gi/object.h index a02bc8ab..c3fbad2f 100644 --- a/gi/object.h +++ b/gi/object.h @@ -215,6 +215,9 @@ class ObjectPrototype private: GJS_JSAPI_RETURN_CONVENTION bool get_parent_proto(JSContext* cx, JS::MutableHandleObject proto) const; + GJS_JSAPI_RETURN_CONVENTION + bool get_parent_constructor(JSContext* cx, + JS::MutableHandleObject constructor) const; [[nodiscard]] bool is_vfunc_unchanged(GIVFuncInfo* info); static void vfunc_invalidated_notify(void* data, GClosure* closure); -- cgit v1.2.1