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,11 +159,12 @@ static Object* array_species_create(GlobalObject& global_object, Object& origina
|
||||||
return {};
|
return {};
|
||||||
if (constructor.is_constructor()) {
|
if (constructor.is_constructor()) {
|
||||||
auto& constructor_function = constructor.as_function();
|
auto& constructor_function = constructor.as_function();
|
||||||
if (&constructor_function.global_object() != &global_object) {
|
auto* constructor_realm = get_function_realm(global_object, constructor_function);
|
||||||
auto* array_constructor = constructor_function.global_object().array_constructor();
|
if (vm.exception())
|
||||||
if (&constructor_function == array_constructor) {
|
return {};
|
||||||
|
if (constructor_realm != &global_object) {
|
||||||
|
if (&constructor_function == constructor_realm->array_constructor())
|
||||||
constructor = js_undefined();
|
constructor = js_undefined();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue