From 013c2a1c7cda0d5921e2368e5de3a65ed9208625 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 28 Oct 2024 19:55:42 +1300 Subject: [PATCH] LibWeb: Verify that all overloads contain Unscopable if present It would be strange for the IDL to be defined as such, so instead of leaving a FIXME comment, let's just verify that this doesn't happen in practise incase it does end up happening in reality. --- .../CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index a0dc6e4f4b3..5ff07358c08 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -3280,8 +3280,8 @@ void @class_name@::initialize(JS::Realm& realm) function_generator.set("function.name:snakecase", make_input_acceptable_cpp(overload_set.key.to_snakecase())); function_generator.set("function.length", ByteString::number(get_shortest_function_length(overload_set.value))); - // FIXME: What if only some of the overloads are Unscopable? if (any_of(overload_set.value, [](auto const& function) { return function.extended_attributes.contains("Unscopable"); })) { + VERIFY(all_of(overload_set.value, [](auto const& function) { return function.extended_attributes.contains("Unscopable"); })); function_generator.append(R"~~~( MUST(unscopable_object->create_data_property("@function.name@", JS::Value(true))); )~~~");