Set.h 739 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/HashTable.h>
  8. #include <LibJS/Runtime/GlobalObject.h>
  9. #include <LibJS/Runtime/Object.h>
  10. #include <LibJS/Runtime/Value.h>
  11. namespace JS {
  12. class Set : public Object {
  13. JS_OBJECT(Set, Object);
  14. public:
  15. static Set* create(GlobalObject&);
  16. explicit Set(Object& prototype);
  17. virtual ~Set() override;
  18. OrderedHashTable<Value, ValueTraits> const& values() const { return m_values; };
  19. OrderedHashTable<Value, ValueTraits>& values() { return m_values; };
  20. private:
  21. virtual void visit_edges(Visitor& visitor) override;
  22. OrderedHashTable<Value, ValueTraits> m_values;
  23. };
  24. }