Skip to content
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

deps: update ada to 2.5.1 #48319

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion deps/ada/ada.cpp
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down
19 changes: 14 additions & 5 deletions deps/ada/ada.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<uint16_t>(parsed_port)
: std::nullopt;
}
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions test/fixtures/wpt/url/resources/percent-encoding.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,5 @@
"output": {
"utf-8": "%C3%A1|"
}
},
"Surrogate!",
{
"input": "\ud800",
"output": {
"utf-8": "%EF%BF%BD",
"windows-1252": "%26%2365533%3B"
}
}
]
168 changes: 168 additions & 0 deletions test/fixtures/wpt/url/resources/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": ""
}
]
2 changes: 1 addition & 1 deletion test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"path": "streams"
},
"url": {
"commit": "c4726447f3bad1c71244fb99c98738ff0354a034",
"commit": "84782d931516aa13cfe32dc7eaa1377b4d947d66",
"path": "url"
},
"user-timing": {
Expand Down