ladybird/Userland/Libraries/LibJS/Runtime/Symbol.cpp
Linus Groh 6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00

29 lines
689 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(Optional<DeprecatedString> description, bool is_global)
: m_description(move(description))
, m_is_global(is_global)
{
}
Symbol* js_symbol(Heap& heap, Optional<DeprecatedString> description, bool is_global)
{
return heap.allocate_without_realm<Symbol>(move(description), is_global);
}
Symbol* js_symbol(VM& vm, Optional<DeprecatedString> description, bool is_global)
{
return js_symbol(vm.heap(), move(description), is_global);
}
}