diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 46e2da926cc..fdcd1fabbb4 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -3906,6 +3906,8 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@) WebIDL::log_trace(vm, "@class_name@::@attribute.setter_callback@"); [[maybe_unused]] auto& realm = *vm.current_realm(); auto* impl = TRY(impl_from(vm)); + if (vm.argument_count() < 1) + return vm.throw_completion(JS::ErrorType::BadArgCountOne, "@namespaced_name@ setter"); auto value = vm.argument(0); )~~~"); @@ -4033,6 +4035,8 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@) { WebIDL::log_trace(vm, "@class_name@::@attribute.setter_callback@"); auto this_value = vm.this_value(); + if (vm.argument_count() < 1) + return vm.throw_completion(JS::ErrorType::BadArgCountOne, "@namespaced_name@ setter"); GC::Ptr window; if (this_value.is_object()) { if (is(this_value.as_object())) { @@ -4060,6 +4064,8 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@) auto this_value = vm.this_value(); if (!this_value.is_object() || !is<@fully_qualified_name@>(this_value.as_object())) return vm.throw_completion(JS::ErrorType::NotAnObjectOfType, "@namespaced_name@"); + if (vm.argument_count() < 1) + return vm.throw_completion(JS::ErrorType::BadArgCountOne, "@namespaced_name@ setter"); TRY(this_value.as_object().internal_define_own_property("@attribute.name@", JS::PropertyDescriptor { .value = vm.argument(0), .writable = true })); return JS::js_undefined(); } @@ -4074,6 +4080,8 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@) { WebIDL::log_trace(vm, "@class_name@::@attribute.setter_callback@"); auto* impl = TRY(impl_from(vm)); + if (vm.argument_count() < 1) + return vm.throw_completion(JS::ErrorType::BadArgCountOne, "@namespaced_name@ setter"); auto value = vm.argument(0); auto receiver = TRY(throw_dom_exception_if_needed(vm, [&]() { return impl->@attribute.cpp_name@(); }));