From 53893b825426b6b2ab917c5dae7645f2208cfec1 Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Sat, 3 Jun 2023 16:46:11 +0000 Subject: [PATCH 1/3] deps: update ada to 2.5.1 --- deps/ada/ada.cpp | 2 +- deps/ada/ada.h | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp index 570a659d118de5..855d5b9360392d 100644 --- a/deps/ada/ada.cpp +++ b/deps/ada/ada.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2023-05-25 16:09:25 -0400. Do not edit! */ +/* auto-generated on 2023-06-03 12:40:57 -0400. Do not edit! */ /* begin file src/ada.cpp */ #include "ada.h" /* begin file src/checkers.cpp */ diff --git a/deps/ada/ada.h b/deps/ada/ada.h index e48e9e6ee2d265..4846b3172e6c64 100644 --- a/deps/ada/ada.h +++ b/deps/ada/ada.h @@ -1,4 +1,4 @@ -/* auto-generated on 2023-05-25 16:09:25 -0400. Do not edit! */ +/* auto-generated on 2023-06-03 12:40:57 -0400. Do not edit! */ /* begin file include/ada.h */ /** * @file ada.h @@ -5544,7 +5544,11 @@ ada_really_inline size_t url::parse_port(std::string_view view, } ada_log("parse_port: is_valid = ", is_valid); if (is_valid) { - port = (r.ec == std::errc() && scheme_default_port() != parsed_port) + // scheme_default_port can return 0, and we should allow 0 as a base port. + auto default_port = scheme_default_port(); + bool is_port_valid = (default_port == 0 && parsed_port == 0) || + (default_port != parsed_port); + port = (r.ec == std::errc() && is_port_valid) ? std::optional(parsed_port) : std::nullopt; } @@ -6428,7 +6432,12 @@ ada_really_inline size_t url_aggregator::parse_port( } ada_log("parse_port: is_valid = ", is_valid); if (is_valid) { - if (r.ec == std::errc() && scheme_default_port() != parsed_port) { + ada_log("parse_port", r.ec == std::errc()); + // scheme_default_port can return 0, and we should allow 0 as a base port. + auto default_port = scheme_default_port(); + bool is_port_valid = (default_port == 0 && parsed_port == 0) || + (default_port != parsed_port); + if (r.ec == std::errc() && is_port_valid) { update_base_port(parsed_port); } else { clear_port(); @@ -6485,14 +6494,14 @@ inline std::ostream &operator<<(std::ostream &out, #ifndef ADA_ADA_VERSION_H #define ADA_ADA_VERSION_H -#define ADA_VERSION "2.5.0" +#define ADA_VERSION "2.5.1" namespace ada { enum { ADA_VERSION_MAJOR = 2, ADA_VERSION_MINOR = 5, - ADA_VERSION_REVISION = 0, + ADA_VERSION_REVISION = 1, }; } // namespace ada From a1a8d44ffe1778e14072f4e5fede39b14b447c6a Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sat, 3 Jun 2023 12:48:36 -0400 Subject: [PATCH 2/3] test: update url web-platform tests --- test/fixtures/wpt/README.md | 2 +- .../wpt/url/resources/percent-encoding.json | 8 - .../wpt/url/resources/urltestdata.json | 168 ++++++++++++++++++ test/fixtures/wpt/versions.json | 2 +- test/wpt/status/url.json | 3 + 5 files changed, 173 insertions(+), 10 deletions(-) diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index a9a60875ee7dd2..ef1d4622607d13 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -27,7 +27,7 @@ Last update: - resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing - resources: https://github.com/web-platform-tests/wpt/tree/919874f84f/resources - streams: https://github.com/web-platform-tests/wpt/tree/51750bc8d7/streams -- url: https://github.com/web-platform-tests/wpt/tree/c4726447f3/url +- url: https://github.com/web-platform-tests/wpt/tree/84782d9315/url - 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/resources/percent-encoding.json b/test/fixtures/wpt/url/resources/percent-encoding.json index bd81edbdc35ee3..eccd1db62fe601 100644 --- a/test/fixtures/wpt/url/resources/percent-encoding.json +++ b/test/fixtures/wpt/url/resources/percent-encoding.json @@ -44,13 +44,5 @@ "output": { "utf-8": "%C3%A1|" } - }, - "Surrogate!", - { - "input": "\ud800", - "output": { - "utf-8": "%EF%BF%BD", - "windows-1252": "%26%2365533%3B" - } } ] diff --git a/test/fixtures/wpt/url/resources/urltestdata.json b/test/fixtures/wpt/url/resources/urltestdata.json index 58f6b87a8624bf..ec189871d90814 100644 --- a/test/fixtures/wpt/url/resources/urltestdata.json +++ b/test/fixtures/wpt/url/resources/urltestdata.json @@ -7755,6 +7755,21 @@ "search": "", "hash": "" }, + { + "input": "blob:http://example.org:88/", + "base": null, + "href": "blob:http://example.org:88/", + "origin": "http://example.org:88", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "http://example.org:88/", + "search": "", + "hash": "" + }, { "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", "base": null, @@ -7785,6 +7800,129 @@ "search": "", "hash": "" }, + "blob: in blob:", + { + "input": "blob:blob:", + "base": null, + "href": "blob:blob:", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "blob:", + "search": "", + "hash": "" + }, + { + "input": "blob:blob:https://example.org/", + "base": null, + "href": "blob:blob:https://example.org/", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "blob:https://example.org/", + "search": "", + "hash": "" + }, + "Non-http(s): in blob:", + { + "input": "blob:about:blank", + "base": null, + "href": "blob:about:blank", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "about:blank", + "search": "", + "hash": "" + }, + { + "input": "blob:file://host/path", + "base": null, + "href": "blob:file://host/path", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "file://host/path", + "search": "", + "hash": "" + }, + { + "input": "blob:ftp://host/path", + "base": null, + "href": "blob:ftp://host/path", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "ftp://host/path", + "search": "", + "hash": "" + }, + { + "input": "blob:ws://example.org/", + "base": null, + "href": "blob:ws://example.org/", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "ws://example.org/", + "search": "", + "hash": "" + }, + { + "input": "blob:wss://example.org/", + "base": null, + "href": "blob:wss://example.org/", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "wss://example.org/", + "search": "", + "hash": "" + }, + "Percent-encoded http: in blob:", + { + "input": "blob:http%3a//example.org/", + "base": null, + "href": "blob:http%3a//example.org/", + "origin": "null", + "protocol": "blob:", + "username": "", + "password": "", + "host": "", + "hostname": "", + "port": "", + "pathname": "http%3a//example.org/", + "search": "", + "hash": "" + }, "Invalid IPv4 radix digits", { "input": "http://0x7f.0.0.0x7g", @@ -9362,5 +9500,35 @@ "input": "stun://[:1]", "base": null, "failure": true + }, + { + "input": "w://x:0", + "base": null, + "href": "w://x:0", + "origin": "null", + "protocol": "w:", + "username": "", + "password": "", + "host": "x:0", + "hostname": "x", + "port": "0", + "pathname": "", + "search": "", + "hash": "" + }, + { + "input": "west://x:0", + "base": null, + "href": "west://x:0", + "origin": "null", + "protocol": "west:", + "username": "", + "password": "", + "host": "x:0", + "hostname": "x", + "port": "0", + "pathname": "", + "search": "", + "hash": "" } ] diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 0fa4067b7d56a5..ca7db61b785126 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -68,7 +68,7 @@ "path": "streams" }, "url": { - "commit": "c4726447f3bad1c71244fb99c98738ff0354a034", + "commit": "84782d931516aa13cfe32dc7eaa1377b4d947d66", "path": "url" }, "user-timing": { diff --git a/test/wpt/status/url.json b/test/wpt/status/url.json index 0b4beb54549495..67dbfb3528b5d6 100644 --- a/test/wpt/status/url.json +++ b/test/wpt/status/url.json @@ -17,5 +17,8 @@ }, "javascript-urls.window.js": { "skip": "requires document.body reference" + }, + "url-origin.any.js": { + "skip": "implementation not up to date" } } From 593ef9e6a9f513b5bdb12d3fed4b06a051968674 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sat, 3 Jun 2023 12:52:23 -0400 Subject: [PATCH 3/3] url: conform to origin getter spec changes --- lib/internal/url.js | 4 +++- test/wpt/status/url.json | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/internal/url.js b/lib/internal/url.js index ccd89830f91ded..27e599bfc8fda7 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -840,7 +840,9 @@ class URL { if (path.length > 0) { try { const out = new URL(path); - if (out.#context.scheme_type !== 1) { + // Only return origin of scheme is `http` or `https` + // Otherwise return a new opaque origin (null). + if (out.#context.scheme_type === 0 || out.#context.scheme_type === 2) { return `${out.protocol}//${out.host}`; } } catch { diff --git a/test/wpt/status/url.json b/test/wpt/status/url.json index 67dbfb3528b5d6..0b4beb54549495 100644 --- a/test/wpt/status/url.json +++ b/test/wpt/status/url.json @@ -17,8 +17,5 @@ }, "javascript-urls.window.js": { "skip": "requires document.body reference" - }, - "url-origin.any.js": { - "skip": "implementation not up to date" } }