1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:27:45 +00:00

LibWeb: Return undefined from event handler setters, not an empty value

This commit is contained in:
Linus Groh 2021-09-24 13:19:13 +02:00
parent a1a164e6b8
commit 1a7136b37a

View file

@ -705,12 +705,14 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::history_getter)
} else if (value.is_string()) { \
cpp_value.string = value.as_string().string(); \
} else { \
return {}; \
return JS::js_undefined(); \
} \
(void)throw_dom_exception_if_needed(vm, global_object, [&] { \
auto result = throw_dom_exception_if_needed(vm, global_object, [&] { \
return impl->set_##attribute(cpp_value); \
}); \
if (should_return_empty(result)) \
return {}; \
return JS::js_undefined(); \
}
ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE)
#undef __ENUMERATE