@@ -576,7 +576,7 @@ export class Parser {
576576 rv . push ( "\t" ) ;
577577 break ;
578578 case "u" :
579- [ codepoint , index ] = this . decodeEscapeSequence ( value , index , token ) ;
579+ [ codepoint , index ] = this . decodeHexChar ( value , index , token ) ;
580580 rv . push ( this . stringFromCodePoint ( codepoint , token ) ) ;
581581 break ;
582582 default :
@@ -605,7 +605,7 @@ export class Parser {
605605 * @param token - The token for the string value.
606606 * @returns - A codepoint, new index tuple.
607607 */
608- protected decodeEscapeSequence (
608+ protected decodeHexChar (
609609 value : string ,
610610 index : number ,
611611 token : Token ,
@@ -620,7 +620,7 @@ export class Parser {
620620 }
621621
622622 index += 1 ; // Move past 'u'
623- let codepoint = this . parseInt16 ( value . slice ( index , index + 4 ) , token ) ;
623+ let codepoint = this . parseHexDigits ( value . slice ( index , index + 4 ) , token ) ;
624624
625625 if ( isLowSurrogate ( codepoint ) ) {
626626 throw new JSONPathSyntaxError (
@@ -644,7 +644,7 @@ export class Parser {
644644 ) ;
645645 }
646646
647- const lowSurrogate = this . parseInt16 (
647+ const lowSurrogate = this . parseHexDigits (
648648 value . slice ( index + 6 , index + 10 ) ,
649649 token ,
650650 ) ;
@@ -675,7 +675,7 @@ export class Parser {
675675 * Note that we're not using `parseInt(digits, 16)` because it accepts `+`
676676 * and `-` and things we don't allow.
677677 */
678- protected parseInt16 ( digits : string , token : Token ) : number {
678+ protected parseHexDigits ( digits : string , token : Token ) : number {
679679 const encoder = new TextEncoder ( ) ;
680680 let codepoint = 0 ;
681681 for ( const digit of encoder . encode ( digits ) ) {
0 commit comments