/* * Copyright (c) 2020, Matthew Olsson * Copyright (c) 2022, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace JS { class Symbol final : public Cell { JS_CELL(Symbol, Cell); public: [[nodiscard]] static NonnullGCPtr create(VM&, Optional description, bool is_global); virtual ~Symbol() = default; DeprecatedString description() const { return m_description.value_or(""); } Optional const& raw_description() const { return m_description; } bool is_global() const { return m_is_global; } DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted("Symbol({})", description()); } private: Symbol(Optional, bool); Optional m_description; bool m_is_global; }; }