Skip to content

deps: update ada to v3.2.1 and update web-platform tests #57429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,987 changes: 2,504 additions & 2,483 deletions deps/ada/ada.cpp

Large diffs are not rendered by default.

387 changes: 208 additions & 179 deletions deps/ada/ada.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/node_url_pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void URLPattern::New(const FunctionCallbackInfo<Value>& args) {
}

auto url_pattern = parse_url_pattern<URLPatternRegexProvider>(
arg0,
std::move(arg0),
base_url ? &base_url_view : nullptr,
options.has_value() ? &options.value() : nullptr);

Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Last update:
- resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing
- resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources
- streams: https://github.com/web-platform-tests/wpt/tree/bc9dcbbf1a/streams
- url: https://github.com/web-platform-tests/wpt/tree/a23788b77a/url
- urlpattern: https://github.com/web-platform-tests/wpt/tree/3b6b19853a/urlpattern
- url: https://github.com/web-platform-tests/wpt/tree/d86fcc9e87/url
- urlpattern: https://github.com/web-platform-tests/wpt/tree/827d52cc6e/urlpattern
- user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
Expand Down
21 changes: 2 additions & 19 deletions test/fixtures/wpt/url/IdnaTestV2.window.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
promise_test(() => fetch("resources/IdnaTestV2.json").then(res => res.json()).then(runTests), "Loading data…");

// Performance impact of this seems negligible (performance.now() diff in WebKit went from 48 to 52)
// and there was a preference to let more non-ASCII hit the parser.
function encodeHostEndingCodePoints(input) {
let output = "";
for (const codePoint of input) {
if ([":", "/", "?", "#", "\\"].includes(codePoint)) {
output += encodeURIComponent(codePoint);
} else {
output += codePoint;
}
}
return output;
}

function runTests(idnaTests) {
for (const idnaTest of idnaTests) {
if (typeof idnaTest === "string") {
Expand All @@ -22,15 +8,12 @@ function runTests(idnaTests) {
if (idnaTest.input === "") {
continue // cannot test empty string input through new URL()
}
// Percent-encode the input such that ? and equivalent code points do not end up counting as
// part of the URL, but are parsed through the host parser instead.
const encodedInput = encodeHostEndingCodePoints(idnaTest.input);

test(() => {
if (idnaTest.output === null) {
assert_throws_js(TypeError, () => new URL(`https://${encodedInput}/x`));
assert_throws_js(TypeError, () => new URL(`https://${idnaTest.input}/x`));
} else {
const url = new URL(`https://${encodedInput}/x`);
const url = new URL(`https://${idnaTest.input}/x`);
assert_equals(url.host, idnaTest.output);
assert_equals(url.hostname, idnaTest.output);
assert_equals(url.pathname, "/x");
Expand Down
8,075 changes: 5,562 additions & 2,513 deletions test/fixtures/wpt/url/resources/IdnaTestV2.json

Large diffs are not rendered by default.

76 changes: 74 additions & 2 deletions test/fixtures/wpt/url/resources/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,42 @@
"host": "example.com",
"hostname": "example.com"
}
},
{
"href": "https://test.invalid/",
"new_value": "*",
"expected": {
"href": "https://*/",
"host": "*",
"hostname": "*"
}
},
{
"href": "https://test.invalid/",
"new_value": "x@x",
"expected": {
"href": "https://test.invalid/",
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "foo\t\r\nbar",
"expected": {
"href": "https://foobar/",
"host": "foobar",
"hostname": "foobar"
}
},
{
"href": "https://test.invalid/",
"new_value": "><",
"expected": {
"href": "https://test.invalid/",
"host": "test.invalid",
"hostname": "test.invalid"
}
}
],
"hostname": [
Expand Down Expand Up @@ -1552,6 +1588,42 @@
"host": "example.com",
"hostname": "example.com"
}
},
{
"href": "https://test.invalid/",
"new_value": "*",
"expected": {
"href": "https://*/",
"host": "*",
"hostname": "*"
}
},
{
"href": "https://test.invalid/",
"new_value": "x@x",
"expected": {
"href": "https://test.invalid/",
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "foo\t\r\nbar",
"expected": {
"href": "https://foobar/",
"host": "foobar",
"hostname": "foobar"
}
},
{
"href": "https://test.invalid/",
"new_value": "><",
"expected": {
"href": "https://test.invalid/",
"host": "test.invalid",
"hostname": "test.invalid"
}
}
],
"port": [
Expand Down Expand Up @@ -1921,8 +1993,8 @@
"href": "a:/",
"new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
"expected": {
"href": "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9",
"pathname": "/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
"href": "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]%5E_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9",
"pathname": "/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]%5E_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
}
},
{
Expand Down
9 changes: 4 additions & 5 deletions test/fixtures/wpt/url/resources/toascii.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
},
{
"input": "look\u180Eout.net",
"output": null
"output": "lookout.net"
},
{
"input": "look\u2060out.net",
Expand Down Expand Up @@ -291,7 +291,7 @@
},
{
"input": "look\u206Bout.net",
"output": null
"output": "lookout.net"
},
{
"input": "look\uDB40\uDC01out.net",
Expand Down Expand Up @@ -319,16 +319,15 @@
},
{
"input": "\u04C0.com",
"output": null
"output": "xn--s5a.com"
},
{
"comment": "This is U+2F868 (which is mapped to U+36FC starting with Unicode 16.0)",
"input": "\uD87E\uDC68.com",
"output": "xn--snl.com"
},
{
"input": "\u2183.com",
"output": null
"output": "xn--r5g.com"
},
{
"input": "look\u034Fout.net",
Expand Down
23 changes: 19 additions & 4 deletions test/fixtures/wpt/url/resources/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8507,6 +8507,21 @@
"search": "",
"username": ""
},
{
"input": "non-special:cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/",
"base": null,
"hash": "",
"host": "",
"hostname": "",
"href": "non-special:cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/",
"origin": "null",
"password": "",
"pathname": "cannot-be-a-base-url-!\"$%&'()*+,-.;<=>@[\\]^_`{|}~@/",
"port": "",
"protocol": "non-special:",
"search": "",
"username": ""
},
{
"input": "https://www.example.com/path{\u007Fpath.html?query'\u007F=query#fragment<\u007Ffragment",
"base": null,
Expand Down Expand Up @@ -8634,10 +8649,10 @@
"hash": "",
"host": "host",
"hostname": "host",
"href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
"href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]%5E_%60%7B|%7D~",
"origin": "null",
"password": "",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]%5E_%60%7B|%7D~",
"port":"",
"protocol": "foo:",
"search": "",
Expand All @@ -8649,10 +8664,10 @@
"hash": "",
"host": "host",
"hostname": "host",
"href": "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
"href": "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~",
"origin": "wss://host",
"password": "",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B|%7D~",
"port":"",
"protocol": "wss:",
"search": "",
Expand Down
21 changes: 19 additions & 2 deletions test/fixtures/wpt/urlpattern/resources/urlpatterntestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2432,8 +2432,10 @@
},
{
"pattern": [{ "hostname": "bad#hostname" }],
"inputs": [{ "hostname": "bad" }],
"exactly_empty_components": ["port"],
"inputs": [{ "hostname": "bad" }],
"expected_obj": {
"hostname": "bad"
},
"expected_match": {
"hostname": { "input": "bad", "groups": {} }
}
Expand All @@ -2445,6 +2447,9 @@
{
"pattern": [{ "hostname": "bad/hostname" }],
"inputs": [{ "hostname": "bad" }],
"expected_obj": {
"hostname": "bad"
},
"expected_match": {
"hostname": { "input": "bad", "groups": {} }
}
Expand Down Expand Up @@ -2480,6 +2485,9 @@
{
"pattern": [{ "hostname": "bad\\\\hostname" }],
"inputs": [{ "hostname": "badhostname" }],
"expected_obj": {
"hostname": "bad"
},
"expected_match": null
},
{
Expand All @@ -2493,20 +2501,29 @@
{
"pattern": [{ "hostname": "bad\nhostname" }],
"inputs": [{ "hostname": "badhostname" }],
"expected_obj": {
"hostname": "badhostname"
},
"expected_match": {
"hostname": { "input": "badhostname", "groups": {} }
}
},
{
"pattern": [{ "hostname": "bad\rhostname" }],
"inputs": [{ "hostname": "badhostname" }],
"expected_obj": {
"hostname": "badhostname"
},
"expected_match": {
"hostname": { "input": "badhostname", "groups": {} }
}
},
{
"pattern": [{ "hostname": "bad\thostname" }],
"inputs": [{ "hostname": "badhostname" }],
"expected_obj": {
"hostname": "badhostname"
},
"expected_match": {
"hostname": { "input": "badhostname", "groups": {} }
}
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@
"path": "streams"
},
"url": {
"commit": "a23788b77a947304b2b3159d8efda492727ab623",
"commit": "d86fcc9e8764155485975a2a9bbfc5ec4aa9e75b",
"path": "url"
},
"urlpattern": {
"commit": "3b6b19853a928ec9bfa28e9046c3cf601f160e42",
"commit": "827d52cc6e31939974f91cda7c0c77ef61d4444b",
"path": "urlpattern"
},
"user-timing": {
Expand Down
57 changes: 0 additions & 57 deletions test/known_issues/test-whatwg-url-custom-domainto.js

This file was deleted.

Loading
Loading