diff --git a/js/public/CharacterEncoding.h b/js/public/CharacterEncoding.h index 6d8ca12a14f2..21fe34012994 100644 --- a/js/public/CharacterEncoding.h +++ b/js/public/CharacterEncoding.h @@ -40,6 +40,20 @@ class Latin1Chars : public mozilla::Range { aLength) {} }; +/* + * Like Latin1Chars, but the chars are const. + */ +class ConstLatin1Chars : public mozilla::Range { + typedef mozilla::Range Base; + + public: + using CharT = Latin1Char; + + ConstLatin1Chars() = default; + ConstLatin1Chars(const Latin1Char* aChars, size_t aLength) + : Base(aChars, aLength) {} +}; + /* * A Latin1Chars, but with \0 termination for C compatibility. */