LibWeb/URLPattern: Implement the URLPattern constructors

The underlying URL::Pattern implementation still has to be fully
implemented, but this does complete the IDL wrapper layer of the
implementation.
This commit is contained in:
Shannon Booth 2025-03-01 14:47:36 +13:00 committed by Tim Flynn
commit ba93e2a8a3
Notes: github-actions[bot] 2025-03-04 21:52:53 +00:00
2 changed files with 22 additions and 6 deletions

View file

@ -24,6 +24,7 @@ class URLPattern : public Bindings::PlatformObject {
GC_DECLARE_ALLOCATOR(URLPattern);
public:
static WebIDL::ExceptionOr<GC::Ref<URLPattern>> create(JS::Realm&, URLPatternInput const&, Optional<String> const& base_url, URLPatternOptions const& = {});
static WebIDL::ExceptionOr<GC::Ref<URLPattern>> construct_impl(JS::Realm&, URLPatternInput const&, String const& base_url, URLPatternOptions const& = {});
static WebIDL::ExceptionOr<GC::Ref<URLPattern>> construct_impl(JS::Realm&, URLPatternInput const&, URLPatternOptions const& = {});
@ -45,7 +46,7 @@ public:
protected:
virtual void initialize(JS::Realm&) override;
explicit URLPattern(JS::Realm&);
explicit URLPattern(JS::Realm&, URL::Pattern::Pattern);
private:
// https://urlpattern.spec.whatwg.org/#ref-for-url-pattern%E2%91%A0