ladybird/Userland/Libraries/LibJS/Runtime/SymbolObject.cpp
Lenny Maiorani d00b79568f Libraries: Use default constructors/destructors in LibJS
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-16 16:19:40 +00:00

30 lines
702 B
C++

/*
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Symbol.h>
#include <LibJS/Runtime/SymbolObject.h>
namespace JS {
SymbolObject* SymbolObject::create(GlobalObject& global_object, Symbol& primitive_symbol)
{
return global_object.heap().allocate<SymbolObject>(global_object, primitive_symbol, *global_object.symbol_prototype());
}
SymbolObject::SymbolObject(Symbol& symbol, Object& prototype)
: Object(prototype)
, m_symbol(symbol)
{
}
void SymbolObject::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(&m_symbol);
}
}