@@ -660,8 +660,8 @@ static bool advanceIfValidContinuationOfOperator(char const *&ptr,
660660
661661// / Returns true if the given string is entirely whitespace (considering only
662662// / those whitespace code points permitted in raw identifiers).
663- static bool isEntirelyWhitespace (StringRef string) {
664- if (string.empty ()) return false ;
663+ static bool isEscapedIdentifierEntirelyWhitespace (StringRef string) {
664+ if (string.empty ()) return true ;
665665 char const *p = string.data (), *end = string.end ();
666666 if (!advanceIf (p, end, isPermittedRawIdentifierWhitespace))
667667 return false ;
@@ -703,7 +703,7 @@ bool Lexer::isValidAsEscapedIdentifier(StringRef string) {
703703 ;
704704 if (p != end)
705705 return false ;
706- return !isEntirelyWhitespace (string);
706+ return !isEscapedIdentifierEntirelyWhitespace (string);
707707}
708708
709709// / Determines if the given string is a valid operator identifier,
@@ -2315,7 +2315,8 @@ void Lexer::lexEscapedIdentifier() {
23152315 // If we have the terminating "`", it's an escaped/raw identifier, unless it
23162316 // contained only operator characters or was entirely whitespace.
23172317 StringRef IdStr (IdentifierStart, CurPtr - IdentifierStart);
2318- if (*CurPtr == ' `' && !isOperator (IdStr) && !isEntirelyWhitespace (IdStr)) {
2318+ if (*CurPtr == ' `' && !isOperator (IdStr) &&
2319+ !isEscapedIdentifierEntirelyWhitespace (IdStr)) {
23192320 ++CurPtr;
23202321 formEscapedIdentifierToken (Quote);
23212322 return ;
0 commit comments