From 9de01cc4d1cdb7e0b2f84c5d0cf7f3d50efcfb0f Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Fri, 4 Apr 2025 04:21:01 -0400 Subject: [PATCH] deps: update ada to 3.2.2 PR-URL: https://github.com/nodejs/node/pull/57693 Reviewed-By: James M Snell Reviewed-By: Daniel Lemire Reviewed-By: Luigi Pinca Reviewed-By: Moshe Atlow --- deps/ada/ada.cpp | 14 +- deps/ada/ada.h | 7 +- test/fixtures/wpt/README.md | 4 +- .../wpt/url/IdnaTestV2-removed.window.js | 21 +++ .../wpt/url/resources/IdnaTestV2-removed.json | 104 +++++++++++++++ .../wpt/url/resources/setters_tests.json | 68 +++++++--- test/fixtures/wpt/url/resources/toascii.json | 12 +- .../wpt/url/resources/urltestdata.json | 120 ++++++++++++++++++ .../wpt/url/url-setters-a-area.window.js | 53 ++++---- test/fixtures/wpt/url/url-setters.any.js | 33 +++-- .../wpt/url/url-statics-canparse.any.js | 5 + .../wpt/url/urlsearchparams-delete.any.js | 12 +- .../resources/urlpatterntestdata.json | 49 ++++++- test/fixtures/wpt/versions.json | 4 +- test/wpt/status/urlpattern.json | 16 +-- 15 files changed, 424 insertions(+), 98 deletions(-) create mode 100644 test/fixtures/wpt/url/IdnaTestV2-removed.window.js create mode 100644 test/fixtures/wpt/url/resources/IdnaTestV2-removed.json diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp index bc87c1ede1f..854def2adb3 100644 --- a/deps/ada/ada.cpp +++ b/deps/ada/ada.cpp @@ -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: { diff --git a/deps/ada/ada.h b/deps/ada/ada.h index da4c9190cc5..821066ac6e9 100644 --- a/deps/ada/ada.h +++ b/deps/ada/ada.h @@ -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, 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::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 diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 563148c0dbe..ebdb87fcc1d 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -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 diff --git a/test/fixtures/wpt/url/IdnaTestV2-removed.window.js b/test/fixtures/wpt/url/IdnaTestV2-removed.window.js new file mode 100644 index 00000000000..0f70f84816a --- /dev/null +++ b/test/fixtures/wpt/url/IdnaTestV2-removed.window.js @@ -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 : ""}`); + } +} diff --git a/test/fixtures/wpt/url/resources/IdnaTestV2-removed.json b/test/fixtures/wpt/url/resources/IdnaTestV2-removed.json new file mode 100644 index 00000000000..523dac3bfa1 --- /dev/null +++ b/test/fixtures/wpt/url/resources/IdnaTestV2-removed.json @@ -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 + } +] diff --git a/test/fixtures/wpt/url/resources/setters_tests.json b/test/fixtures/wpt/url/resources/setters_tests.json index c47797c4d61..e7072cd6afd 100644 --- a/test/fixtures/wpt/url/resources/setters_tests.json +++ b/test/fixtures/wpt/url/resources/setters_tests.json @@ -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": "" } }, diff --git a/test/fixtures/wpt/url/resources/toascii.json b/test/fixtures/wpt/url/resources/toascii.json index 02291962ebc..588ef150f9c 100644 --- a/test/fixtures/wpt/url/resources/toascii.json +++ b/test/fixtures/wpt/url/resources/toascii.json @@ -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", diff --git a/test/fixtures/wpt/url/resources/urltestdata.json b/test/fixtures/wpt/url/resources/urltestdata.json index 214ed0852aa..d1a06f6319d 100644 --- a/test/fixtures/wpt/url/resources/urltestdata.json +++ b/test/fixtures/wpt/url/resources/urltestdata.json @@ -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", diff --git a/test/fixtures/wpt/url/url-setters-a-area.window.js b/test/fixtures/wpt/url/url-setters-a-area.window.js index 6a5e762cd42..0012595cc46 100644 --- a/test/fixtures/wpt/url/url-setters-a-area.window.js +++ b/test/fixtures/wpt/url/url-setters-a-area.window.js @@ -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); } - }, ": " + 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]) + }, `: ${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); } - }, ": " + name) + }, `: ${name}`); } } } diff --git a/test/fixtures/wpt/url/url-setters.any.js b/test/fixtures/wpt/url/url-setters.any.js index fe88175ac63..66b3d9b4f9d 100644 --- a/test/fixtures/wpt/url/url-setters.any.js +++ b/test/fixtures/wpt/url/url-setters.any.js @@ -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}`); } } } diff --git a/test/fixtures/wpt/url/url-statics-canparse.any.js b/test/fixtures/wpt/url/url-statics-canparse.any.js index 74f3da31f0d..9b352029d85 100644 --- a/test/fixtures/wpt/url/url-statics-canparse.any.js +++ b/test/fixtures/wpt/url/url-statics-canparse.any.js @@ -15,6 +15,11 @@ "base": "aaa:b", "expected": false }, + { + "url": undefined, + "base": "https://test:test/", + "expected": false + }, { "url": "aaa:/b", "base": undefined, diff --git a/test/fixtures/wpt/url/urlsearchparams-delete.any.js b/test/fixtures/wpt/url/urlsearchparams-delete.any.js index c597142c51d..09a5dccb648 100644 --- a/test/fixtures/wpt/url/urlsearchparams-delete.any.js +++ b/test/fixtures/wpt/url/urlsearchparams-delete.any.js @@ -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(); diff --git a/test/fixtures/wpt/urlpattern/resources/urlpatterntestdata.json b/test/fixtures/wpt/urlpattern/resources/urlpatterntestdata.json index f92ab76b71d..a613b6a74b5 100644 --- a/test/fixtures/wpt/urlpattern/resources/urlpatterntestdata.json +++ b/test/fixtures/wpt/urlpattern/resources/urlpatterntestdata.json @@ -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" ], diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 5eeb76397f8..caca55700b9 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -72,11 +72,11 @@ "path": "streams" }, "url": { - "commit": "d86fcc9e8764155485975a2a9bbfc5ec4aa9e75b", + "commit": "9504a83e014b6b26d6c09eaee89c6b83cb7410c2", "path": "url" }, "urlpattern": { - "commit": "6ceca69d26b8ecde9952d6633c17694e03a086f7", + "commit": "f07d05f49c679a62dd112e18aa07405859745952", "path": "urlpattern" }, "user-timing": { diff --git a/test/wpt/status/urlpattern.json b/test/wpt/status/urlpattern.json index abaac489214..fcee23fb35a 100644 --- a/test/wpt/status/urlpattern.json +++ b/test/wpt/status/urlpattern.json @@ -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": {} }