1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibJS: Don't repeat attributes in {Boolean,Symbol}Prototype

This commit is contained in:
Linus Groh 2021-06-13 20:08:36 +01:00
parent 3ed6a3fea8
commit 4f6aa38434
2 changed files with 6 additions and 4 deletions

View file

@ -20,8 +20,9 @@ void BooleanPrototype::initialize(GlobalObject& global_object)
{
auto& vm = this->vm();
BooleanObject::initialize(global_object);
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);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.toString, to_string, 0, attr);
define_native_function(vm.names.valueOf, value_of, 0, attr);
}
BooleanPrototype::~BooleanPrototype()

View file

@ -26,9 +26,10 @@ void SymbolPrototype::initialize(GlobalObject& global_object)
{
auto& vm = this->vm();
Object::initialize(global_object);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.toString, to_string, 0, attr);
define_native_function(vm.names.valueOf, value_of, 0, attr);
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, 1, Attribute::Configurable);
// 20.4.3.6 Symbol.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag