mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
33 lines
660 B
C++
33 lines
660 B
C++
/*
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibJS/Heap/Heap.h>
|
|
#include <LibJS/Runtime/Symbol.h>
|
|
#include <LibJS/Runtime/VM.h>
|
|
|
|
namespace JS {
|
|
|
|
Symbol::Symbol(String description, bool is_global)
|
|
: m_description(move(description))
|
|
, m_is_global(is_global)
|
|
{
|
|
}
|
|
|
|
Symbol::~Symbol()
|
|
{
|
|
}
|
|
|
|
Symbol* js_symbol(Heap& heap, String description, bool is_global)
|
|
{
|
|
return heap.allocate_without_global_object<Symbol>(move(description), is_global);
|
|
}
|
|
|
|
Symbol* js_symbol(VM& vm, String description, bool is_global)
|
|
{
|
|
return js_symbol(vm.heap(), move(description), is_global);
|
|
}
|
|
|
|
}
|