Skip to content

Commit

Permalink
fixup! src: implement whatwg's URLPattern spec
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Jan 27, 2025
1 parent 71e1e9e commit 676ee51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/node_url_pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void URLPattern::New(const FunctionCallbackInfo<Value>& args) {
base_url = base_url_buffer.ToString();
} else if (args[1]->IsObject()) {
CHECK(!options.has_value());
options = URLPatternOptions::FromJsObject(env, args[0].As<Object>());
options = URLPatternOptions::FromJsObject(env, args[1].As<Object>());
if (!options) {
THROW_ERR_INVALID_ARG_TYPE(env, "options.ignoreCase must be a boolean");
return;
Expand Down
8 changes: 2 additions & 6 deletions test/wpt/status/urlpattern.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
},
Expand All @@ -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"
]
}
}
Expand Down

0 comments on commit 676ee51

Please sign in to comment.