/* * Copyright (c) 2020, Matthew Olsson * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include namespace JS { GC_DEFINE_ALLOCATOR(SymbolObject); GC::Ref SymbolObject::create(Realm& realm, Symbol& primitive_symbol) { return realm.create(primitive_symbol, realm.intrinsics().symbol_prototype()); } SymbolObject::SymbolObject(Symbol& symbol, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) , m_symbol(symbol) { } void SymbolObject::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); visitor.visit(m_symbol); } }