diff --git a/Libraries/LibWeb/URLPattern/URLPattern.cpp b/Libraries/LibWeb/URLPattern/URLPattern.cpp index ea8c6b8cd60f7..e077df88227f4 100644 --- a/Libraries/LibWeb/URLPattern/URLPattern.cpp +++ b/Libraries/LibWeb/URLPattern/URLPattern.cpp @@ -36,4 +36,11 @@ WebIDL::ExceptionOr> URLPattern::construct_impl(JS::Realm& r return realm.create(realm); } +// https://urlpattern.spec.whatwg.org/#dom-urlpattern-exec +Optional URLPattern::exec(URLPatternInput const&, Optional const&) const +{ + dbgln("FIXME: Implement URLPattern::match"); + return {}; +} + } diff --git a/Libraries/LibWeb/URLPattern/URLPattern.h b/Libraries/LibWeb/URLPattern/URLPattern.h index e2ed2fe6c9f73..01c9acece194a 100644 --- a/Libraries/LibWeb/URLPattern/URLPattern.h +++ b/Libraries/LibWeb/URLPattern/URLPattern.h @@ -16,6 +16,7 @@ namespace Web::URLPattern { using URLPatternInit = URL::Pattern::Init; using URLPatternInput = URL::Pattern::Input; using URLPatternOptions = URL::Pattern::Options; +using URLPatternResult = URL::Pattern::Result; // https://urlpattern.spec.whatwg.org/#urlpattern class URLPattern : public Bindings::PlatformObject { @@ -26,6 +27,8 @@ class URLPattern : public Bindings::PlatformObject { static WebIDL::ExceptionOr> construct_impl(JS::Realm&, URLPatternInput const&, String const& base_url, URLPatternOptions const& = {}); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, URLPatternInput const&, URLPatternOptions const& = {}); + Optional exec(URLPatternInput const&, Optional const&) const; + virtual ~URLPattern() override; protected: diff --git a/Libraries/LibWeb/URLPattern/URLPattern.idl b/Libraries/LibWeb/URLPattern/URLPattern.idl index fa007c8ef294f..7553e5efdacbc 100644 --- a/Libraries/LibWeb/URLPattern/URLPattern.idl +++ b/Libraries/LibWeb/URLPattern/URLPattern.idl @@ -8,7 +8,7 @@ interface URLPattern { [FIXME] boolean test(optional URLPatternInput input = {}, optional USVString baseURL); - [FIXME] URLPatternResult? exec(optional URLPatternInput input = {}, optional USVString baseURL); + URLPatternResult? exec(optional URLPatternInput input = {}, optional USVString baseURL); [FIXME] readonly attribute USVString protocol; [FIXME] readonly attribute USVString username;