1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

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

@ -37,6 +37,8 @@ void ArrayConstructor::initialize(GlobalObject& global_object)
define_native_function(vm.names.from, from, 1, attr);
define_native_function(vm.names.isArray, is_array, 1, attr);
define_native_function(vm.names.of, of, 0, attr);
define_native_property(vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable);
}
Value ArrayConstructor::call()
@ -151,4 +153,9 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::of)
return array;
}
JS_DEFINE_NATIVE_GETTER(ArrayConstructor::symbol_species_getter)
{
return vm.this_value(global_object);
}
}