mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
LibJS: Store and return undefined Symbol description
Instead of the current incorrect behaviour of just defaulting to an empty string.
This commit is contained in:
parent
4aff4249aa
commit
dac971b4ae
5 changed files with 17 additions and 19 deletions
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
Symbol::Symbol(String description, bool is_global)
|
||||
Symbol::Symbol(Optional<String> description, bool is_global)
|
||||
: m_description(move(description))
|
||||
, m_is_global(is_global)
|
||||
{
|
||||
|
@ -20,12 +20,12 @@ Symbol::~Symbol()
|
|||
{
|
||||
}
|
||||
|
||||
Symbol* js_symbol(Heap& heap, String description, bool is_global)
|
||||
Symbol* js_symbol(Heap& heap, Optional<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)
|
||||
Symbol* js_symbol(VM& vm, Optional<String> description, bool is_global)
|
||||
{
|
||||
return js_symbol(vm.heap(), move(description), is_global);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue