From 676ee51598822fc4dc60ae7b4c9c63ebf240f5a7 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sun, 26 Jan 2025 20:17:23 -0500 Subject: [PATCH] fixup! src: implement whatwg's URLPattern spec --- src/node_url_pattern.cc | 2 +- test/wpt/status/urlpattern.json | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/node_url_pattern.cc b/src/node_url_pattern.cc index b979c741dfa3095..8c6c9d995faca4a 100644 --- a/src/node_url_pattern.cc +++ b/src/node_url_pattern.cc @@ -182,7 +182,7 @@ void URLPattern::New(const FunctionCallbackInfo& args) { base_url = base_url_buffer.ToString(); } else if (args[1]->IsObject()) { CHECK(!options.has_value()); - options = URLPatternOptions::FromJsObject(env, args[0].As()); + options = URLPatternOptions::FromJsObject(env, args[1].As()); if (!options) { THROW_ERR_INVALID_ARG_TYPE(env, "options.ignoreCase must be a boolean"); return; diff --git a/test/wpt/status/urlpattern.json b/test/wpt/status/urlpattern.json index 56e7d4317880076..58877b850172802 100644 --- a/test/wpt/status/urlpattern.json +++ b/test/wpt/status/urlpattern.json @@ -18,9 +18,7 @@ "Pattern: [{\"hostname\":\"bad\\\\\\\\hostname\"}] Inputs: undefined", "Pattern: [{\"hostname\":\"bad\\nhostname\"}] Inputs: undefined", "Pattern: [{\"hostname\":\"bad\\rhostname\"}] Inputs: undefined", - "Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: undefined", - "Pattern: [{\"pathname\":\"/foo/bar\"},{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO/BAR\"}]", - "Pattern: [\"https://example.com:8080/foo?bar#baz\",{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO\",\"search\":\"BAR\",\"hash\":\"BAZ\",\"baseURL\":\"https://example.com:8080\"}]" + "Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: undefined" ] } }, @@ -34,9 +32,7 @@ "Pattern: [{\"hostname\":\"bad\\\\\\\\hostname\"}] Inputs: undefined", "Pattern: [{\"hostname\":\"bad\\nhostname\"}] Inputs: undefined", "Pattern: [{\"hostname\":\"bad\\rhostname\"}] Inputs: undefined", - "Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: undefined", - "Pattern: [{\"pathname\":\"/foo/bar\"},{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO/BAR\"}]", - "Pattern: [\"https://example.com:8080/foo?bar#baz\",{\"ignoreCase\":true}] Inputs: [{\"pathname\":\"/FOO\",\"search\":\"BAR\",\"hash\":\"BAZ\",\"baseURL\":\"https://example.com:8080\"}]" + "Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: undefined" ] } }