mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
LibJS: Use the GetFunctionRealm abstract-op in ArraySpeciesCreate
This commit is contained in:
parent
c254e4cf10
commit
dfed8f61cb
1 changed files with 5 additions and 4 deletions
|
@ -159,13 +159,14 @@ static Object* array_species_create(GlobalObject& global_object, Object& origina
|
|||
return {};
|
||||
if (constructor.is_constructor()) {
|
||||
auto& constructor_function = constructor.as_function();
|
||||
if (&constructor_function.global_object() != &global_object) {
|
||||
auto* array_constructor = constructor_function.global_object().array_constructor();
|
||||
if (&constructor_function == array_constructor) {
|
||||
auto* constructor_realm = get_function_realm(global_object, constructor_function);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
if (constructor_realm != &global_object) {
|
||||
if (&constructor_function == constructor_realm->array_constructor())
|
||||
constructor = js_undefined();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (constructor.is_object()) {
|
||||
constructor = constructor.as_object().get(*vm.well_known_symbol_species()).value_or(js_undefined());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue