diff options
author | Evan Welsh <contact@evanwelsh.com> | 2021-09-12 00:26:06 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2021-09-24 15:28:16 -0700 |
commit | 16032db6cd22f7d429011c8d0fbaf275c87f9ab5 (patch) | |
tree | 8c7c346af088676bba1db35f4bc055e465069d78 /gi/object.h | |
parent | 47f0f0b9d5d81c38b9ac96a6e6ef7ebc5f986bfe (diff) | |
download | gjs-16032db6cd22f7d429011c8d0fbaf275c87f9ab5.tar.gz |
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.
Diffstat (limited to 'gi/object.h')
-rw-r--r-- | gi/object.h | 3 |
1 files changed, 3 insertions, 0 deletions
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); |