--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -1489,48 +1489,48 @@ TokenStreamSpecific<CharT, AnyCharsAcces
// We have encountered a '\': check for a Unicode escape sequence after it.
// Return the length of the escape sequence and the encoded code point (by
// value) if we found a Unicode escape sequence, and skip all code units
// involed. Otherwise, return 0 and don't advance along the buffer.
template<typename CharT, class AnyCharsAccess>
uint32_t
GeneralTokenStreamChars<CharT, AnyCharsAccess>::matchUnicodeEscape(uint32_t* codePoint)
{
- MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == '\\');
+ MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == CharT('\\'));
int32_t unit = getCodeUnit();
if (unit != 'u') {
// NOTE: |unit| may be EOF here.
ungetCodeUnit(unit);
- MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == '\\');
+ MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == CharT('\\'));
return 0;
}
char16_t v;
unit = getCodeUnit();
if (JS7_ISHEX(unit) && this->sourceUnits.matchHexDigits(3, &v)) {
*codePoint = (JS7_UNHEX(unit) << 12) | v;
return 5;
}
if (unit == '{')
return matchExtendedUnicodeEscape(codePoint);
// NOTE: |unit| may be EOF here, so this ungets either one or two units.
ungetCodeUnit(unit);
ungetCodeUnit('u');
- MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == '\\');
+ MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == CharT('\\'));
return 0;
}
template<typename CharT, class AnyCharsAccess>
uint32_t
GeneralTokenStreamChars<CharT, AnyCharsAccess>::matchExtendedUnicodeEscape(uint32_t* codePoint)
{
- MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == '{');
+ MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == CharT('{'));
int32_t unit = getCodeUnit();
// Skip leading zeroes.
uint32_t leadingZeroes = 0;
while (unit == '0') {
leadingZeroes++;
unit = getCodeUnit();
@@ -1551,49 +1551,49 @@ GeneralTokenStreamChars<CharT, AnyCharsA
(unit != EOF); // subtract a get if it didn't contribute to length
if (unit == '}' && (leadingZeroes > 0 || i > 0) && code <= unicode::NonBMPMax) {
*codePoint = code;
return gotten;
}
this->sourceUnits.unskipCodeUnits(gotten);
- MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == '\\');
+ MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == CharT('\\'));
return 0;
}
template<typename CharT, class AnyCharsAccess>
uint32_t
GeneralTokenStreamChars<CharT, AnyCharsAccess>::matchUnicodeEscapeIdStart(uint32_t* codePoint)
{
uint32_t length = matchUnicodeEscape(codePoint);
if (MOZ_LIKELY(length > 0)) {
if (MOZ_LIKELY(unicode::IsIdentifierStart(*codePoint)))
return length;
this->sourceUnits.unskipCodeUnits(length);
}
- MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == '\\');
+ MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == CharT('\\'));
return 0;
}
template<typename CharT, class AnyCharsAccess>
bool
GeneralTokenStreamChars<CharT, AnyCharsAccess>::matchUnicodeEscapeIdent(uint32_t* codePoint)
{
uint32_t length = matchUnicodeEscape(codePoint);
if (MOZ_LIKELY(length > 0)) {
if (MOZ_LIKELY(unicode::IsIdentifierPart(*codePoint)))
return true;
this->sourceUnits.unskipCodeUnits(length);
}
- MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == '\\');
+ MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == CharT('\\'));
return false;
}
template<typename CharT, class AnyCharsAccess>
bool
TokenStreamSpecific<CharT, AnyCharsAccess>::getDirectives(bool isMultiline,
bool shouldWarnDeprecated)
{
@@ -2138,17 +2138,17 @@ TokenStreamSpecific<CharT, AnyCharsAcces
newNumberToken(dval, decimalPoint, start, modifier, out);
return true;
}
template<typename CharT, class AnyCharsAccess>
MOZ_MUST_USE bool
TokenStreamSpecific<CharT, AnyCharsAccess>::regexpLiteral(TokenStart start, TokenKind* out)
{
- MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == '/');
+ MOZ_ASSERT(this->sourceUnits.previousCodeUnit() == CharT('/'));
this->charBuffer.clear();
auto ProcessNonAsciiCodePoint = [this](int32_t lead) {
MOZ_ASSERT(lead != EOF);
MOZ_ASSERT(!this->isAsciiCodePoint(lead));
char32_t codePoint;
if (!this->getNonAsciiCodePointDontNormalize(this->toCharT(lead), &codePoint))
@@ -2783,18 +2783,18 @@ TokenStreamSpecific<CharT, AnyCharsAcces
auto noteBadToken = MakeScopeExit([this]() {
this->badToken();
});
auto ReportPrematureEndOfLiteral = [this, untilChar](unsigned errnum) {
// Unicode separators aren't end-of-line in template or (as of
// recently) string literals, so this assertion doesn't allow them.
MOZ_ASSERT(this->sourceUnits.atEnd() ||
- this->sourceUnits.peekCodeUnit() == '\r' ||
- this->sourceUnits.peekCodeUnit() == '\n',
+ this->sourceUnits.peekCodeUnit() == CharT('\r') ||
+ this->sourceUnits.peekCodeUnit() == CharT('\n'),
"must be parked at EOF or EOL to call this function");
// The various errors reported here include language like "in a ''
// literal" or similar, with '' being '', "", or `` as appropriate.
const char delimiters[] = { untilChar, untilChar, '\0' };
this->error(errnum, delimiters);
return;