LibWeb/Bindings: Generate undefined in a union as 'Empty'

This can only ever be undefined, and no other JS value, so it makes
sense to use undefined to represent this case.
This commit is contained in:
Shannon Booth 2025-01-12 22:50:03 +13:00 committed by Tim Ledbetter
commit dfdcfc8e88
Notes: github-actions[bot] 2025-01-12 18:40:27 +00:00
5 changed files with 13 additions and 7 deletions

View file

@ -25,7 +25,7 @@ public:
virtual ~CustomElementRegistry() override;
JS::ThrowCompletionOr<void> define(String const& name, WebIDL::CallbackType* constructor, ElementDefinitionOptions options);
Variant<GC::Root<WebIDL::CallbackType>, JS::Value> get(String const& name) const;
Variant<GC::Root<WebIDL::CallbackType>, Empty> get(String const& name) const;
Optional<String> get_name(GC::Root<WebIDL::CallbackType> const& constructor) const;
WebIDL::ExceptionOr<GC::Ref<WebIDL::Promise>> when_defined(String const& name);
void upgrade(GC::Ref<DOM::Node> root) const;