mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +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: https://github.com/LadybirdBrowser/ladybird/commit/b93d2b7be2b 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,7 +4249,8 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@)
|
|||
auto value = vm.argument(0);
|
||||
|
||||
auto receiver = TRY(throw_dom_exception_if_needed(vm, [&]() { return impl->@attribute.cpp_name@(); }));
|
||||
TRY(receiver->set(JS::PropertyKey { "@put_forwards_identifier@"_fly_string, JS::PropertyKey::StringMayBeNumber::No }, value, JS::Object::ShouldThrowExceptions::Yes));
|
||||
if (receiver != JS::js_null())
|
||||
TRY(receiver->set(JS::PropertyKey { "@put_forwards_identifier@"_fly_string, JS::PropertyKey::StringMayBeNumber::No }, value, JS::Object::ShouldThrowExceptions::Yes));
|
||||
|
||||
return JS::js_undefined();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue