deps: update ada to 3.2.2

PR-URL: https://github.com/nodejs/node/pull/57693
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
Yagiz Nizipli 2025-04-04 04:21:01 -04:00 committed by GitHub
parent 32e5e815ef
commit 9de01cc4d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 424 additions and 98 deletions

14
deps/ada/ada.cpp vendored
View File

@ -1,4 +1,4 @@
/* auto-generated on 2025-03-10 13:14:56 -0400. Do not edit! */
/* auto-generated on 2025-03-30 13:24:42 -0400. Do not edit! */
/* begin file src/ada.cpp */
#include "ada.h"
/* begin file src/checkers.cpp */
@ -13334,10 +13334,18 @@ result_type parse_url_impl(std::string_view user_input,
input_position = input_size + 1;
}
url.has_opaque_path = true;
// This is a really unlikely scenario in real world. We should not seek
// to optimize it.
url.update_base_pathname(unicode::percent_encode(
view, character_sets::C0_CONTROL_PERCENT_ENCODE));
if (view.ends_with(' ')) {
std::string modified_view =
std::string(view.begin(), view.end() - 1) + "%20";
url.update_base_pathname(unicode::percent_encode(
modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE));
} else {
url.update_base_pathname(unicode::percent_encode(
view, character_sets::C0_CONTROL_PERCENT_ENCODE));
}
break;
}
case state::PORT: {

7
deps/ada/ada.h vendored
View File

@ -1,4 +1,4 @@
/* auto-generated on 2025-03-10 13:14:56 -0400. Do not edit! */
/* auto-generated on 2025-03-30 13:24:42 -0400. Do not edit! */
/* begin file include/ada.h */
/**
* @file ada.h
@ -5859,7 +5859,6 @@ tl::expected<url_pattern<regex_provider>, errors> parse_url_pattern_impl(
// TODO: Optimization opportunity.
if (scheme::is_special(*processed_init->protocol)) {
std::string_view port = processed_init->port.value();
helpers::trim_c0_whitespace(port);
if (std::to_string(scheme::get_special_port(*processed_init->protocol)) ==
port) {
processed_init->port->clear();
@ -10503,14 +10502,14 @@ constructor_string_parser<regex_provider>::parse(std::string_view input) {
#ifndef ADA_ADA_VERSION_H
#define ADA_ADA_VERSION_H
#define ADA_VERSION "3.2.1"
#define ADA_VERSION "3.2.2"
namespace ada {
enum {
ADA_VERSION_MAJOR = 3,
ADA_VERSION_MINOR = 2,
ADA_VERSION_REVISION = 1,
ADA_VERSION_REVISION = 2,
};
} // namespace ada

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/d86fcc9e87/url
- urlpattern: https://github.com/web-platform-tests/wpt/tree/6ceca69d26/urlpattern
- url: https://github.com/web-platform-tests/wpt/tree/9504a83e01/url
- urlpattern: https://github.com/web-platform-tests/wpt/tree/f07d05f49c/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

View File

@ -0,0 +1,21 @@
promise_test(() => fetch("resources/IdnaTestV2-removed.json").then(res => res.json()).then(runTests), "Loading data…");
function runTests(idnaTests) {
for (const idnaTest of idnaTests) {
if (typeof idnaTest === "string") {
continue // skip comments
}
test(() => {
if (idnaTest.output === null) {
assert_throws_js(TypeError, () => new URL(`https://${idnaTest.input}/x`));
} else {
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");
assert_equals(url.href, `https://${idnaTest.output}/x`);
}
}, `ToASCII("${idnaTest.input}")${idnaTest.comment ? " " + idnaTest.comment : ""}`);
}
}

View File

@ -0,0 +1,104 @@
[
"This is generated with the help from ../tools/IdnaTestV2-compare.py.",
"These tests are from an older IdnaTestV2 and thus the comment line may no longer be accurate.",
{
"comment": "P1; V6; V3 (ignored)",
"input": "-\udb40\ude56\ua867\uff0e\udb40\ude82\ud8dc\udd83\ud83c\udd09",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488\u00df",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488SS",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488ss",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud83c\udd04\uff0e\u1cdc\u2488Ss",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03c2",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03c2",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03a3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u1160\u200d\u03c3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03a3",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u0756\u3002\u3164\u200d\u03c3",
"output": null
},
{
"comment": "P1; V6",
"input": "\ud83c\udd07\u4f10\ufe12.\ud831\ude5a\ua8c4",
"output": null
},
{
"comment": "P1; V5; V6",
"input": "\ud802\ude3f.\ud83c\udd06\u2014",
"output": null
},
{
"comment": "C2; P1; V5; V6",
"input": "\u1c32\ud83c\udd08\u2f9b\u05a6\uff0e\u200d\uda7e\udd64\u07fd",
"output": null
},
{
"comment": "C2; P1; V5; V6",
"input": "\ud83e\udc9f\ud83c\udd08\u200d\ua84e\uff61\u0f84",
"output": null
},
{
"comment": "P1; V6",
"input": "\udaa5\udeaa\uff61\ud83c\udd02",
"output": null
},
{
"comment": "C2; P1; V6",
"input": "\u186f\u2689\u59f6\ud83c\udd09\uff0e\u06f7\u200d\ud83c\udfaa\u200d",
"output": null
},
{
"comment": "C1; P1; V5; V6",
"input": "\ua67d\u200c\ud87e\uddf5\ud83c\udd06\uff61\u200c\ud804\udc42\u1b01",
"output": null
},
{
"comment": "C1; P1; V5; V6",
"input": "\ua67d\u200c\u9723\ud83c\udd06\uff61\u200c\ud804\udc42\u1b01",
"output": null
},
{
"comment": "C1; P1; V5; V6; V3 (ignored)",
"input": "-\u1897\u200c\ud83c\udd04.\ud805\udf22",
"output": null
}
]

View File

@ -1177,6 +1177,24 @@
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/@aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/:aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
}
],
"hostname": [
@ -1624,6 +1642,24 @@
"host": "test.invalid",
"hostname": "test.invalid"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/@aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
},
{
"href": "https://test.invalid/",
"new_value": "test/:aaa",
"expected": {
"href": "https://test/",
"host": "test",
"hostname": "test"
}
}
],
"port": [
@ -2241,12 +2277,12 @@
}
},
{
"comment": "Drop trailing spaces from trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query",
"new_value": "",
"expected": {
"href": "data:space",
"pathname": "space",
"href": "data:space%20",
"pathname": "space%20",
"search": ""
}
},
@ -2254,17 +2290,17 @@
"href": "sc:space ?query",
"new_value": "",
"expected": {
"href": "sc:space",
"pathname": "space",
"href": "sc:space%20",
"pathname": "space%20",
"search": ""
}
},
{
"comment": "Do not drop trailing spaces from non-trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query#fragment",
"new_value": "",
"expected": {
"href": "data:space #fragment",
"href": "data:space %20#fragment",
"search": ""
}
},
@ -2272,7 +2308,7 @@
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
"href": "sc:space #fragment",
"href": "sc:space %20#fragment",
"search": ""
}
},
@ -2429,12 +2465,12 @@
}
},
{
"comment": "Drop trailing spaces from trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space #fragment",
"new_value": "",
"expected": {
"href": "data:space",
"pathname": "space",
"href": "data:space %20",
"pathname": "space %20",
"hash": ""
}
},
@ -2442,17 +2478,17 @@
"href": "sc:space #fragment",
"new_value": "",
"expected": {
"href": "sc:space",
"pathname": "space",
"href": "sc:space %20",
"pathname": "space %20",
"hash": ""
}
},
{
"comment": "Do not drop trailing spaces from non-trailing opaque paths",
"comment": "Trailing spaces and opaque paths",
"href": "data:space ?query#fragment",
"new_value": "",
"expected": {
"href": "data:space ?query",
"href": "data:space %20?query",
"hash": ""
}
},
@ -2460,7 +2496,7 @@
"href": "sc:space ?query#fragment",
"new_value": "",
"expected": {
"href": "sc:space ?query",
"href": "sc:space %20?query",
"hash": ""
}
},

View File

@ -1,6 +1,9 @@
[
"This contains assorted IDNA tests that IdnaTestV2 might not cover.",
"Feel free to deduplicate with a clear commit message.",
"",
"If the test only applies to the URL Standard's 'domain to ASCII', ",
"and not to TR46's ToASCII, then tag it with `urlStandardOnly`",
{
"comment": "Label with hyphens in 3rd and 4th position",
"input": "aa--",
@ -239,11 +242,13 @@
},
{
"input": "www.lookout.net\u2A7480",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "www\u00A0.lookout.net",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "\u1680lookout.net",
@ -251,7 +256,8 @@
},
{
"input": "\u001flookout.net",
"output": null
"output": null,
"urlStandardOnly": true
},
{
"input": "look\u06DDout.net",

View File

@ -3778,6 +3778,126 @@
"search": "",
"hash": ""
},
{
"input": "non-special:opaque ",
"base": null,
"href": "non-special:opaque",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "opaque",
"search": "",
"hash": ""
},
{
"input": "non-special:opaque ?hi",
"base": null,
"href": "non-special:opaque %20?hi",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "opaque %20",
"search": "?hi",
"hash": ""
},
{
"input": "non-special:opaque #hi",
"base": null,
"href": "non-special:opaque %20#hi",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "opaque %20",
"search": "",
"hash": "#hi"
},
{
"input": "non-special:opaque x?hi",
"base": null,
"href": "non-special:opaque x?hi",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "opaque x",
"search": "?hi",
"hash": ""
},
{
"input": "non-special:opaque x#hi",
"base": null,
"href": "non-special:opaque x#hi",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "opaque x",
"search": "",
"hash": "#hi"
},
{
"input": "non-special:opaque \t\t \t#hi",
"base": null,
"href": "non-special:opaque %20#hi",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "opaque %20",
"search": "",
"hash": "#hi"
},
{
"input": "non-special:opaque \t\t #hi",
"base": null,
"href": "non-special:opaque %20#hi",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "opaque %20",
"search": "",
"hash": "#hi"
},
{
"input": "non-special:opaque\t\t \r #hi",
"base": null,
"href": "non-special:opaque %20#hi",
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "opaque %20",
"search": "",
"hash": "#hi"
},
"Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
{
"input": "http://www.foo。bar.com",

View File

@ -8,36 +8,37 @@
promise_test(() => fetch("resources/setters_tests.json").then(res => res.json()).then(runURLSettersTests), "Loading data…");
function runURLSettersTests(all_test_cases) {
for (var attribute_to_be_set in all_test_cases) {
if (attribute_to_be_set == "comment") {
function runURLSettersTests(allTestCases) {
for (const [propertyToBeSet, testCases] of Object.entries(allTestCases)) {
if (propertyToBeSet === "comment") {
continue;
}
var test_cases = all_test_cases[attribute_to_be_set];
for(var i = 0, l = test_cases.length; i < l; i++) {
var test_case = test_cases[i];
var name = "Setting <" + test_case.href + ">." + attribute_to_be_set +
" = '" + test_case.new_value + "'";
if ("comment" in test_case) {
name += " " + test_case.comment;
}
const key = test_case.href.split(":")[0];
subsetTestByKey(key, test, function() {
var url = document.createElement("a");
url.href = test_case.href;
url[attribute_to_be_set] = test_case.new_value;
for (var attribute in test_case.expected) {
assert_equals(url[attribute], test_case.expected[attribute])
for (const testCase of testCases) {
const name = `Setting <${testCase.href}>.${propertyToBeSet} = '${testCase.new_value}'${
testCase.comment ? ` ${testCase.comment}` : ''
}`;
const key = testCase.href.split(":")[0];
subsetTestByKey(key, test, () => {
const url = document.createElement("a");
url.href = testCase.href;
url[propertyToBeSet] = testCase.new_value;
for (const [property, expectedValue] of Object.entries(testCase.expected)) {
assert_equals(url[property], expectedValue);
}
}, "<a>: " + name)
subsetTestByKey(key, test, function() {
var url = document.createElement("area");
url.href = test_case.href;
url[attribute_to_be_set] = test_case.new_value;
for (var attribute in test_case.expected) {
assert_equals(url[attribute], test_case.expected[attribute])
}, `<a>: ${name}`);
subsetTestByKey(key, test, () => {
const url = document.createElement("area");
url.href = testCase.href;
url[propertyToBeSet] = testCase.new_value;
for (const [property, expectedValue] of Object.entries(testCase.expected)) {
assert_equals(url[property], expectedValue);
}
}, "<area>: " + name)
}, `<area>: ${name}`);
}
}
}

View File

@ -8,27 +8,26 @@
promise_test(() => fetch("resources/setters_tests.json").then(res => res.json()).then(runURLSettersTests), "Loading data…");
function runURLSettersTests(all_test_cases) {
for (var attribute_to_be_set in all_test_cases) {
if (attribute_to_be_set == "comment") {
function runURLSettersTests(allTestCases) {
for (const [propertyToBeSet, testCases] of Object.entries(allTestCases)) {
if (propertyToBeSet === "comment") {
continue;
}
var test_cases = all_test_cases[attribute_to_be_set];
for(var i = 0, l = test_cases.length; i < l; i++) {
var test_case = test_cases[i];
var name = "Setting <" + test_case.href + ">." + attribute_to_be_set +
" = '" + test_case.new_value + "'";
if ("comment" in test_case) {
name += " " + test_case.comment;
}
for (const test_case of testCases) {
const name = `Setting <${test_case.href}>.${propertyToBeSet} = '${test_case.new_value}'${
test_case.comment ? ` ${test_case.comment}` : ''
}`;
const key = test_case.href.split(":")[0];
subsetTestByKey(key, test, function() {
var url = new URL(test_case.href);
url[attribute_to_be_set] = test_case.new_value;
for (var attribute in test_case.expected) {
assert_equals(url[attribute], test_case.expected[attribute])
subsetTestByKey(key, test, () => {
const url = new URL(test_case.href);
url[propertyToBeSet] = test_case.new_value;
for (const [property, expectedValue] of Object.entries(test_case.expected)) {
assert_equals(url[property], expectedValue);
}
}, "URL: " + name)
}, `URL: ${name}`);
}
}
}

View File

@ -15,6 +15,11 @@
"base": "aaa:b",
"expected": false
},
{
"url": undefined,
"base": "https://test:test/",
"expected": false
},
{
"url": "aaa:/b",
"base": undefined,

View File

@ -50,17 +50,17 @@ test(() => {
url.searchParams.delete('test');
assert_false(url.searchParams.has('test'));
assert_equals(url.search, '');
assert_equals(url.pathname, 'space');
assert_equals(url.href, 'data:space');
}, 'Changing the query of a URL with an opaque path can impact the path');
assert_equals(url.pathname, 'space %20');
assert_equals(url.href, 'data:space %20');
}, 'Changing the query of a URL with an opaque path with trailing spaces');
test(() => {
const url = new URL('data:space ?test#test');
url.searchParams.delete('test');
assert_equals(url.search, '');
assert_equals(url.pathname, 'space ');
assert_equals(url.href, 'data:space #test');
}, 'Changing the query of a URL with an opaque path can impact the path if the URL has no fragment');
assert_equals(url.pathname, 'space %20');
assert_equals(url.href, 'data:space %20#test');
}, 'Changing the query of a URL with an opaque path with trailing spaces and a fragment');
test(() => {
const params = new URLSearchParams();

View File

@ -1202,10 +1202,11 @@
{
"pattern": [{ "protocol": "http", "port": "80 " }],
"inputs": [{ "protocol": "http", "port": "80" }],
"exactly_empty_components": ["port"],
"expected_match": {
"protocol": { "input": "http", "groups": {} }
}
"expected_obj": {
"protocol": "http",
"port": "80"
},
"expected_match": null
},
{
"pattern": [{ "protocol": "http", "port": "100000" }],
@ -1229,6 +1230,34 @@
"port": { "input": "80", "groups": {}}
}
},
{
"pattern": [{ "port": "80" }],
"inputs": [{ "port": "8\t0" }],
"expected_match": {
"port": { "input": "80", "groups": {}}
}
},
{
"pattern": [{ "port": "80" }],
"inputs": [{ "port": "80x" }],
"expected_match": {
"port": { "input": "80", "groups": {}}
}
},
{
"pattern": [{ "port": "80" }],
"inputs": [{ "port": "80?x" }],
"expected_match": {
"port": { "input": "80", "groups": {}}
}
},
{
"pattern": [{ "port": "80" }],
"inputs": [{ "port": "80\\x" }],
"expected_match": {
"port": { "input": "80", "groups": {}}
}
},
{
"pattern": [{ "port": "(.*)" }],
"inputs": [{ "port": "invalid80" }],
@ -1874,7 +1903,17 @@
{
"pattern": [ "https://{sub.}?example{.com/}foo" ],
"inputs": [ "https://example.com/foo" ],
"expected_obj": "error"
"exactly_empty_components": [ "port" ],
"expected_obj": {
"protocol": "https",
"hostname": "{sub.}?example.com",
"pathname": "*"
},
"expected_match": {
"protocol": { "input": "https", "groups": {} },
"hostname": { "input": "example.com", "groups": {} },
"pathname": { "input": "/foo", "groups": { "0": "/foo" } }
}
},
{
"pattern": [ "{https://}example.com/foo" ],

View File

@ -72,11 +72,11 @@
"path": "streams"
},
"url": {
"commit": "d86fcc9e8764155485975a2a9bbfc5ec4aa9e75b",
"commit": "9504a83e014b6b26d6c09eaee89c6b83cb7410c2",
"path": "url"
},
"urlpattern": {
"commit": "6ceca69d26b8ecde9952d6633c17694e03a086f7",
"commit": "f07d05f49c679a62dd112e18aa07405859745952",
"path": "urlpattern"
},
"user-timing": {

View File

@ -8,18 +8,6 @@
"urlpattern-compare.tentative.https.any.js": {
"skip": "compareComponent function is not yet included in the URLPattern spec"
},
"urlpattern.any.js": {
"fail": {
"expected": [
"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\"]"
]
}
}
"urlpattern.any.js": {},
"urlpattern.https.any.js": {}
}