Bug 1283710 - Part 5: Rename message to toStringResult if it is the result of toString. r=bholley,jwalden,froydnj

This commit is contained in:
Tooru Fujisawa
2016-08-14 20:39:31 +09:00
parent 044b5a993c
commit 556e7c80df
19 changed files with 81 additions and 53 deletions

View File

@@ -13,6 +13,7 @@
#include "nscore.h"
#include "mozilla/Assertions.h"
#include "mozilla/SSE.h"
#include "mozilla/TypeTraits.h"
#include "nsCharTraits.h"
@@ -722,4 +723,20 @@ private:
};
#endif // MOZILLA_INTERNAL_API
template<typename Char, typename UnsignedT>
inline UnsignedT
RewindToPriorUTF8Codepoint(const Char* utf8Chars, UnsignedT index)
{
static_assert(mozilla::IsSame<Char, char>::value ||
mozilla::IsSame<Char, unsigned char>::value ||
mozilla::IsSame<Char, signed char>::value,
"UTF-8 data must be in 8-bit units");
static_assert(mozilla::IsUnsigned<UnsignedT>::value, "index type must be unsigned");
while (index > 0 && (utf8Chars[index] & 0xC0) == 0x80)
--index;
return index;
}
#endif /* !defined(nsUTF8Utils_h_) */