summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-06-07 16:52:31 +0300
committerLinus Groh <mail@linusgroh.de>2021-06-07 16:51:09 +0100
commit1c51edb6395c3a9c9be337fca1e1f763d011afed (patch)
treeacadc9d41d67e3989098d68c29c8536acca13505
parent71b4433b0d83714852e882a83808a7d4bbeb6117 (diff)
downloadserenity-1c51edb6395c3a9c9be337fca1e1f763d011afed.zip
LibJS: Add missing length field to Symbol.prototype[Symbol.ToPrimitive]
Since the argument was missing Attribute::Configurable was used as the length, which resulted in incorrect attributes being applied.
-rw-r--r--Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp
index df3eaf44bc..aba05876af 100644
--- a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp
@@ -29,7 +29,7 @@ void SymbolPrototype::initialize(GlobalObject& global_object)
define_native_property(vm.names.description, description_getter, {}, Attribute::Configurable);
define_native_function(vm.names.toString, to_string, 0, Attribute::Writable | Attribute::Configurable);
define_native_function(vm.names.valueOf, value_of, 0, Attribute::Writable | Attribute::Configurable);
- define_native_function(vm.well_known_symbol_to_primitive(), symbol_to_primitive, Attribute::Configurable);
+ define_native_function(vm.well_known_symbol_to_primitive(), symbol_to_primitive, 1, Attribute::Configurable);
define_property(vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Symbol"), Attribute::Configurable);
}