summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Symbol.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-06-15 02:40:55 +0300
committerLinus Groh <mail@linusgroh.de>2021-06-15 18:31:52 +0100
commitdac971b4aec2b36864b984929ab52be8f2015c85 (patch)
tree44cb967d809894153ec9dda913f9f2f087dfd543 /Userland/Libraries/LibJS/Runtime/Symbol.cpp
parent4aff4249aa570fe33b7520d6977391f3de4944fc (diff)
downloadserenity-dac971b4aec2b36864b984929ab52be8f2015c85.zip
LibJS: Store and return undefined Symbol description
Instead of the current incorrect behaviour of just defaulting to an empty string.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Symbol.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Symbol.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Symbol.cpp b/Userland/Libraries/LibJS/Runtime/Symbol.cpp
index 98d3664511..c1f56036bc 100644
--- a/Userland/Libraries/LibJS/Runtime/Symbol.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Symbol.cpp
@@ -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);
}