зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1606568 - Add JS::ConstLatin1Chars. r=jwalden
Useful for the public BigInt API which takes Range<const CharT>. Allows JS::NumberToBigInt(JSContext*, JS::ConstLatin1Chars) in order to match JS::NumberToBigInt(JSContext*, JS::ConstTwoByteChars) which already exists. Differential Revision: https://phabricator.services.mozilla.com/D82797
This commit is contained in:
Родитель
1da86c00bd
Коммит
602751eaef
|
@ -40,6 +40,20 @@ class Latin1Chars : public mozilla::Range<Latin1Char> {
|
|||
aLength) {}
|
||||
};
|
||||
|
||||
/*
|
||||
* Like Latin1Chars, but the chars are const.
|
||||
*/
|
||||
class ConstLatin1Chars : public mozilla::Range<const Latin1Char> {
|
||||
typedef mozilla::Range<const Latin1Char> 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.
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче