LibJS+LibWeb: Return GC::Ptr from Value::as_if

This commit is contained in:
Timothy Flynn
2026-02-27 08:29:11 -05:00
committed by Shannon Booth
parent 9d1f727f43
commit e95db70d2d
Notes: github-actions[bot] 2026-02-27 16:21:14 +00:00
5 changed files with 7 additions and 8 deletions

View File

@@ -135,7 +135,7 @@ Optional<JS::PropertyDescriptor> cross_origin_get_own_property_helper(Variant<HT
auto value = original_descriptor->value;
// 2. If IsCallable(value) is true, then set value to an anonymous built-in function, created in the current Realm Record, that performs the same steps as the IDL operation P on object O.
if (auto* function = value->as_if<JS::FunctionObject>()) {
if (auto function = value->as_if<JS::FunctionObject>()) {
auto name = function->get_without_side_effects(vm.names.name).to_utf16_string_without_side_effects();
auto length_property = function->get_without_side_effects(vm.names.length);
auto length = length_property.is_int32() ? length_property.as_i32() : 0;