/* * Copyright (c) 2020, Matthew Olsson * Copyright (c) 2022-2023, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace JS { class Symbol final : public Cell { GC_CELL(Symbol, Cell); GC_DECLARE_ALLOCATOR(Symbol); public: [[nodiscard]] static GC::Ref create(VM&, Optional description, bool is_global); virtual ~Symbol() = default; Optional const& description() const { return m_description; } bool is_global() const { return m_is_global; } ErrorOr descriptive_string() const; Optional key() const; private: Symbol(Optional, bool); Optional m_description; bool m_is_global; }; }