From 23c5a7a0a3a75df075739b5c42b693ddc13f40bf Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Fri, 5 Jan 2024 21:18:55 +1300 Subject: [PATCH] LibJS: Expose const prototype getter in Object This is used in the temporal proposal in an assertion. --- Userland/Libraries/LibJS/Runtime/Object.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index 8fa9aa1529..757d7ee031 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -229,6 +229,8 @@ public: [[nodiscard]] bool is_typed_array() const { return m_is_typed_array; } void set_is_typed_array() { m_is_typed_array = true; } + Object const* prototype() const { return shape().prototype(); } + protected: enum class GlobalObjectTag { Tag }; enum class ConstructWithoutPrototypeTag { Tag }; @@ -254,7 +256,6 @@ private: void set_shape(Shape& shape) { m_shape = &shape; } Object* prototype() { return shape().prototype(); } - Object const* prototype() const { return shape().prototype(); } bool m_may_interfere_with_indexed_property_access { false };