1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:18:11 +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

@ -35,6 +35,8 @@ void PromiseConstructor::initialize(GlobalObject& global_object)
// define_native_function(vm.names.race, race, 1, attr);
define_native_function(vm.names.reject, reject, 1, attr);
define_native_function(vm.names.resolve, resolve, 1, attr);
define_native_property(vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable);
}
Value PromiseConstructor::call()
@ -113,4 +115,9 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::resolve)
return promise_resolve(global_object, *constructor, value);
}
JS_DEFINE_NATIVE_GETTER(PromiseConstructor::symbol_species_getter)
{
return vm.this_value(global_object);
}
}