summaryrefslogtreecommitdiffstats
path: root/xpcom/string/nsTSubstring.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /xpcom/string/nsTSubstring.cpp
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xpcom/string/nsTSubstring.cpp')
-rw-r--r--xpcom/string/nsTSubstring.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/xpcom/string/nsTSubstring.cpp b/xpcom/string/nsTSubstring.cpp
index ae9fda73c8..cff2031422 100644
--- a/xpcom/string/nsTSubstring.cpp
+++ b/xpcom/string/nsTSubstring.cpp
@@ -1322,6 +1322,9 @@ int_type ToIntegerCommon(const nsTSubstring<T>& aSrc, nsresult* aErrorCode,
break;
// clang-format on
case '-':
+ if constexpr (!std::is_signed_v<int_type>) {
+ return 0;
+ }
negate = true;
break;
default:
@@ -1389,6 +1392,12 @@ int32_t nsTSubstring<T>::ToInteger(nsresult* aErrorCode,
return ToIntegerCommon<T, int32_t>(*this, aErrorCode, aRadix);
}
+template <typename T>
+uint32_t nsTSubstring<T>::ToUnsignedInteger(nsresult* aErrorCode,
+ uint32_t aRadix) const {
+ return ToIntegerCommon<T, uint32_t>(*this, aErrorCode, aRadix);
+}
+
/**
* nsTSubstring::ToInteger64
*/