summaryrefslogtreecommitdiff
path: root/gi/object.h
diff options
context:
space:
mode:
authorEvan Welsh <contact@evanwelsh.com>2021-09-12 00:26:06 -0700
committerPhilip Chimento <philip.chimento@gmail.com>2021-09-24 15:28:16 -0700
commit16032db6cd22f7d429011c8d0fbaf275c87f9ab5 (patch)
tree8c7c346af088676bba1db35f4bc055e465069d78 /gi/object.h
parent47f0f0b9d5d81c38b9ac96a6e6ef7ebc5f986bfe (diff)
downloadgjs-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.h3
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);