mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
IDLGenerators: Don't attempt to set null [PutForwards]
attribute
Previously, attempting to set a `[PutForwards]` annotated attribute, would crash if the associated getter returned null.
This commit is contained in:
parent
ac19b0cda8
commit
b93d2b7be2
Notes:
github-actions[bot]
2025-04-02 13:56:42 +00:00
Author: https://github.com/tcl3
Commit: b93d2b7be2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4183
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 2 additions and 1 deletions
|
@ -4249,6 +4249,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@)
|
||||||
auto value = vm.argument(0);
|
auto value = vm.argument(0);
|
||||||
|
|
||||||
auto receiver = TRY(throw_dom_exception_if_needed(vm, [&]() { return impl->@attribute.cpp_name@(); }));
|
auto receiver = TRY(throw_dom_exception_if_needed(vm, [&]() { return impl->@attribute.cpp_name@(); }));
|
||||||
|
if (receiver != JS::js_null())
|
||||||
TRY(receiver->set(JS::PropertyKey { "@put_forwards_identifier@"_fly_string, JS::PropertyKey::StringMayBeNumber::No }, value, JS::Object::ShouldThrowExceptions::Yes));
|
TRY(receiver->set(JS::PropertyKey { "@put_forwards_identifier@"_fly_string, JS::PropertyKey::StringMayBeNumber::No }, value, JS::Object::ShouldThrowExceptions::Yes));
|
||||||
|
|
||||||
return JS::js_undefined();
|
return JS::js_undefined();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue