mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
f87041bf3a
Resulting in a massive rename across almost everywhere! Alongside the namespace change, we now have the following names: * JS::NonnullGCPtr -> GC::Ref * JS::GCPtr -> GC::Ptr * JS::HeapFunction -> GC::Function * JS::CellImpl -> GC::Cell * JS::Handle -> GC::Root
37 lines
819 B
C++
37 lines
819 B
C++
/*
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
|
* Copyright (c) 2022-2023, Linus Groh <linusg@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
#include <LibJS/Heap/Cell.h>
|
|
|
|
namespace JS {
|
|
|
|
class Symbol final : public Cell {
|
|
GC_CELL(Symbol, Cell);
|
|
GC_DECLARE_ALLOCATOR(Symbol);
|
|
|
|
public:
|
|
[[nodiscard]] static GC::Ref<Symbol> create(VM&, Optional<String> description, bool is_global);
|
|
|
|
virtual ~Symbol() = default;
|
|
|
|
Optional<String> const& description() const { return m_description; }
|
|
bool is_global() const { return m_is_global; }
|
|
|
|
ErrorOr<String> descriptive_string() const;
|
|
Optional<String> key() const;
|
|
|
|
private:
|
|
Symbol(Optional<String>, bool);
|
|
|
|
Optional<String> m_description;
|
|
bool m_is_global;
|
|
};
|
|
|
|
}
|