deps: update ada to v3.2.1

PR-URL: https://github.com/nodejs/node/pull/57429
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Yagiz Nizipli authored and Antoine du Hamel committed 2025-03-18 11:16:11 +01:00
1 parent 8cb3441443
commit 99f93afb9d
15 files changed
+7718 -4697

No files matched your search

+2504 -2483
View File
File diff suppressed because it is too large. Load diff
+208 -179
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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
+2 -19
View File
@@ -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") {
@@ -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");
File diff suppressed because it is too large. Load diff
+74 -2
View File
@@ -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": [
@@ -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": [
@@ -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"
}
},
{
+4 -5
View File
@@ -259,7 +259,7 @@
},
{
"input": "look\u180Eout.net",
"output": null
"output": "lookout.net"
},
{
"input": "look\u2060out.net",
@@ -291,7 +291,7 @@
},
{
"input": "look\u206Bout.net",
"output": null
"output": "lookout.net"
},
{
"input": "look\uDB40\uDC01out.net",
@@ -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",
+19 -4
View File
@@ -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,
@@ -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": "",
@@ -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": "",
@@ -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": {} }
}
@@ -2445,6 +2447,9 @@
{
"pattern": [{ "hostname": "bad/hostname" }],
"inputs": [{ "hostname": "bad" }],
"expected_obj": {
"hostname": "bad"
},
"expected_match": {
"hostname": { "input": "bad", "groups": {} }
}
@@ -2480,6 +2485,9 @@
{
"pattern": [{ "hostname": "bad\\\\hostname" }],
"inputs": [{ "hostname": "badhostname" }],
"expected_obj": {
"hostname": "bad"
},
"expected_match": null
},
{
@@ -2493,6 +2501,9 @@
{
"pattern": [{ "hostname": "bad\nhostname" }],
"inputs": [{ "hostname": "badhostname" }],
"expected_obj": {
"hostname": "badhostname"
},
"expected_match": {
"hostname": { "input": "badhostname", "groups": {} }
}
@@ -2500,6 +2511,9 @@
{
"pattern": [{ "hostname": "bad\rhostname" }],
"inputs": [{ "hostname": "badhostname" }],
"expected_obj": {
"hostname": "badhostname"
},
"expected_match": {
"hostname": { "input": "badhostname", "groups": {} }
}
@@ -2507,6 +2521,9 @@
{
"pattern": [{ "hostname": "bad\thostname" }],
"inputs": [{ "hostname": "badhostname" }],
"expected_obj": {
"hostname": "badhostname"
},
"expected_match": {
"hostname": { "input": "badhostname", "groups": {} }
}
+2 -2
View File
@@ -72,11 +72,11 @@
"path": "streams"
},
"url": {
"commit": "a23788b77a947304b2b3159d8efda492727ab623",
"commit": "d86fcc9e8764155485975a2a9bbfc5ec4aa9e75b",
"path": "url"
},
"urlpattern": {
"commit": "3b6b19853a928ec9bfa28e9046c3cf601f160e42",
"commit": "827d52cc6e31939974f91cda7c0c77ef61d4444b",
"path": "urlpattern"
},
"user-timing": {
@@ -1,57 +0,0 @@
'use strict';
// Tests below are not from WPT.
const common = require('../common');
if (!common.hasIntl)
common.skip('missing Intl');
const assert = require('assert');
const { domainToASCII, domainToUnicode } = require('url');
const tests = require('../fixtures/url-idna');
const fixtures = require('../common/fixtures');
const wptToASCIITests = require(
fixtures.path('wpt', 'url', 'resources', 'toascii.json'),
);
{
const expectedError = { code: 'ERR_MISSING_ARGS', name: 'TypeError' };
assert.throws(() => domainToASCII(), expectedError);
assert.throws(() => domainToUnicode(), expectedError);
assert.strictEqual(domainToASCII(undefined), 'undefined');
assert.strictEqual(domainToUnicode(undefined), 'undefined');
}
{
for (const [i, { ascii, unicode }] of tests.entries()) {
assert.strictEqual(ascii, domainToASCII(unicode),
`domainToASCII(${i + 1})`);
assert.strictEqual(unicode, domainToUnicode(ascii),
`domainToUnicode(${i + 1})`);
assert.strictEqual(ascii, domainToASCII(domainToUnicode(ascii)),
`domainToASCII(domainToUnicode(${i + 1}))`);
assert.strictEqual(unicode, domainToUnicode(domainToASCII(unicode)),
`domainToUnicode(domainToASCII(${i + 1}))`);
}
}
{
for (const [i, test] of wptToASCIITests.entries()) {
if (typeof test === 'string')
continue; // skip comments
const { comment, input, output } = test;
let caseComment = `Case ${i + 1}`;
if (comment)
caseComment += ` (${comment})`;
if (output === null) {
assert.strictEqual(domainToASCII(input), '', caseComment);
assert.strictEqual(domainToUnicode(input), '', caseComment);
} else {
assert.strictEqual(domainToASCII(input), output, caseComment);
const roundtripped = domainToASCII(domainToUnicode(input));
assert.strictEqual(roundtripped, output, caseComment);
}
}
}
@@ -1,86 +0,0 @@
'use strict';
const common = require('../common');
if (!common.hasIntl) {
// A handful of the tests fail when ICU is not included.
common.skip('missing Intl');
}
const fixtures = require('../common/fixtures');
const { test, assert_equals, assert_throws } = require('../common/wpt').harness;
const request = {
response: require(
fixtures.path('wpt', 'url', 'resources', 'toascii.json'),
),
};
// The following tests are copied from WPT. Modifications to them should be
// upstreamed first.
// Refs: https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.window.js
// License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
/* eslint-disable */
// async_test(t => {
// const request = new XMLHttpRequest()
// request.open("GET", "toascii.json")
// request.send()
// request.responseType = "json"
// request.onload = t.step_func_done(() => {
runTests(request.response)
// })
// }, "Loading data…")
function makeURL(type, input) {
input = "https://" + input + "/x"
if(type === "url") {
return new URL(input)
} else {
const url = document.createElement(type)
url.href = input
return url
}
}
function runTests(tests) {
for(var i = 0, l = tests.length; i < l; i++) {
let hostTest = tests[i]
if (typeof hostTest === "string") {
continue // skip comments
}
const typeName = { "url": "URL", "a": "<a>", "area": "<area>" }
// ;["url", "a", "area"].forEach((type) => {
;["url"].forEach((type) => {
test(() => {
if(hostTest.output !== null) {
const url = makeURL("url", hostTest.input)
assert_equals(url.host, hostTest.output)
assert_equals(url.hostname, hostTest.output)
assert_equals(url.pathname, "/x")
assert_equals(url.href, "https://" + hostTest.output + "/x")
} else {
if(type === "url") {
assert_throws(new TypeError, () => makeURL("url", hostTest.input))
} else {
const url = makeURL(type, hostTest.input)
assert_equals(url.host, "")
assert_equals(url.hostname, "")
assert_equals(url.pathname, "")
assert_equals(url.href, "https://" + hostTest.input + "/x")
}
}
}, hostTest.input + " (using " + typeName[type] + ")")
;["host", "hostname"].forEach((val) => {
test(() => {
const url = makeURL(type, "x")
url[val] = hostTest.input
if(hostTest.output !== null) {
assert_equals(url[val], hostTest.output)
} else {
assert_equals(url[val], "x")
}
}, hostTest.input + " (using " + typeName[type] + "." + val + ")")
})
})
}
}
/* eslint-enable */
+1 -10
View File
@@ -10,16 +10,7 @@
]
}
},
"toascii.window.js": {
"fail": {
"note": "Unicode 15.1",
"expected": [
"\uD87E\uDC68.com (using URL)",
"\uD87E\uDC68.com (using URL.host)",
"\uD87E\uDC68.com (using URL.hostname)"
]
}
},
"toascii.window.js": {},
"url-setters-a-area.window.js": {
"skip": "already tested in url-setters.any.js"
},
+2 -14
View File
@@ -11,26 +11,14 @@
"urlpattern.any.js": {
"fail": {
"expected": [
"Pattern: [\"https://{sub.}?example{.com/}foo\"] Inputs: [\"https://example.com/foo\"]",
"Pattern: [{\"hostname\":\"bad#hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad/hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad\\\\\\\\hostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\nhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\rhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]"
"Pattern: [\"https://{sub.}?example{.com/}foo\"] Inputs: [\"https://example.com/foo\"]"
]
}
},
"urlpattern.https.any.js": {
"fail": {
"expected": [
"Pattern: [\"https://{sub.}?example{.com/}foo\"] Inputs: [\"https://example.com/foo\"]",
"Pattern: [{\"hostname\":\"bad#hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad/hostname\"}] Inputs: [{\"hostname\":\"bad\"}]",
"Pattern: [{\"hostname\":\"bad\\\\\\\\hostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\nhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\rhostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]",
"Pattern: [{\"hostname\":\"bad\\thostname\"}] Inputs: [{\"hostname\":\"badhostname\"}]"
"Pattern: [\"https://{sub.}?example{.com/}foo\"] Inputs: [\"https://example.com/foo\"]"
]
}
}