浏览代码

LibJS: Add Object::own_properties() convenience accessor

Andreas Kling 5 年之前
父节点
当前提交
68dec2801d
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Libraries/LibJS/Runtime/Object.h

+ 2 - 0
Libraries/LibJS/Runtime/Object.h

@@ -74,6 +74,8 @@ public:
     virtual Value to_primitive(PreferredType preferred_type = PreferredType::Default) const;
     virtual Value to_string() const;
 
+    const HashMap<FlyString, Value>& own_properties() const { return m_properties; }
+
 private:
     HashMap<FlyString, Value> m_properties;
     Object* m_prototype { nullptr };