Prechádzať zdrojové kódy

LibJS: Expose const prototype getter in Object

This is used in the temporal proposal in an assertion.
Shannon Booth 1 rok pred
rodič
commit
23c5a7a0a3
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      Userland/Libraries/LibJS/Runtime/Object.h

+ 2 - 1
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 };