LibJS: Add the Symbol.species getter to the appropriate built-ins

This commit is contained in:
Idan Horowitz
2021-06-07 19:31:32 +03:00
committed by Linus Groh
parent 39c3aefe5d
commit aefb7995f1
10 changed files with 45 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ void RegExpConstructor::initialize(GlobalObject& global_object)
NativeFunction::initialize(global_object);
define_property(vm.names.prototype, global_object.regexp_prototype(), 0);
define_property(vm.names.length, Value(2), Attribute::Configurable);
define_native_property(vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable);
}
RegExpConstructor::~RegExpConstructor()
@@ -51,4 +53,9 @@ Value RegExpConstructor::construct(Function&)
return RegExpObject::create(global_object(), pattern, flags);
}
JS_DEFINE_NATIVE_GETTER(RegExpConstructor::symbol_species_getter)
{
return vm.this_value(global_object);
}
}