Skip to content

Commit

Permalink
deps: update ada to v1.0.1
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Lemire <[email protected]>
PR-URL: nodejs#46550
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gerhard Stöbich <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
  • Loading branch information
anonrig and lemire committed Apr 11, 2023
1 parent 0c9a8a1 commit 47e8f4e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
18 changes: 18 additions & 0 deletions deps/ada/LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright 2023 Ada authors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 changes: 10 additions & 9 deletions deps/ada/ada.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2023-02-06 08:25:59 -0500. Do not edit! */
/* auto-generated on 2023-02-07 17:26:54 -0500. Do not edit! */
// dofile: invoked with prepath=/Users/yagiz/Developer/url-parser/src, filename=ada.cpp
/* begin file src/ada.cpp */
#include "ada.h"
Expand Down Expand Up @@ -970,6 +970,13 @@ namespace ada::helpers {
} while (true);
}
}

ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept {
if (!url.has_opaque_path) return;
if (url.fragment.has_value()) return;
if (url.query.has_value()) return;
while (!url.path.empty() && url.path.back() == ' ') { url.path.resize(url.path.size()-1); }
}
} // namespace ada::helpers

namespace ada {
Expand Down Expand Up @@ -1650,7 +1657,7 @@ namespace ada {
void url::set_hash(const std::string_view input) {
if (input.empty()) {
fragment = std::nullopt;
// TODO: Potentially strip trailing spaces from an opaque path with this.
helpers::strip_trailing_spaces_from_opaque_path(*this);
return;
}

Expand All @@ -1664,9 +1671,7 @@ namespace ada {
void url::set_search(const std::string_view input) {
if (input.empty()) {
query = std::nullopt;
// Empty this’s query object’s list.
// @todo Implement this if/when we have URLSearchParams.
// Potentially strip trailing spaces from an opaque path with this.
helpers::strip_trailing_spaces_from_opaque_path(*this);
return;
}

Expand All @@ -1679,10 +1684,6 @@ namespace ada {
ada::character_sets::QUERY_PERCENT_ENCODE;

query = ada::unicode::percent_encode(std::string_view(new_value), query_percent_encode_set);

// Set this’s query object’s list to the result of parsing input.
// @todo Implement this if/when we have URLSearchParams.
return ;
}

bool url::set_pathname(const std::string_view input) {
Expand Down
11 changes: 8 additions & 3 deletions deps/ada/ada.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2023-02-06 08:25:59 -0500. Do not edit! */
/* auto-generated on 2023-02-07 17:26:54 -0500. Do not edit! */
// dofile: invoked with prepath=/Users/yagiz/Developer/url-parser/include, filename=ada.h
/* begin file include/ada.h */
/**
Expand Down Expand Up @@ -1774,6 +1774,11 @@ namespace ada::helpers {
*/
ada_really_inline void trim_c0_whitespace(std::string_view& input) noexcept;

/**
* @see https://url.spec.whatwg.org/#potentially-strip-trailing-spaces-from-an-opaque-path
*/
ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept;

} // namespace ada::helpers

#endif // ADA_HELPERS_H
Expand Down Expand Up @@ -4328,14 +4333,14 @@ namespace ada {
#ifndef ADA_ADA_VERSION_H
#define ADA_ADA_VERSION_H

#define ADA_VERSION "1.0.0"
#define ADA_VERSION "1.0.1"

namespace ada {

enum {
ADA_VERSION_MAJOR = 1,
ADA_VERSION_MINOR = 0,
ADA_VERSION_REVISION = 0,
ADA_VERSION_REVISION = 1,
};

} // namespace ada
Expand Down

0 comments on commit 47e8f4e

Please sign in to comment.