File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1040,6 +1040,21 @@ describe('Lexer', () => {
1040
1040
locations : [ { line : 1 , column : 1 } ] ,
1041
1041
} ) ;
1042
1042
1043
+ expectSyntaxError ( '\uD83D\uDE00' ) . to . deep . equal ( {
1044
+ message : 'Syntax Error: Unexpected character: U+1F600.' ,
1045
+ locations : [ { line : 1 , column : 1 } ] ,
1046
+ } ) ;
1047
+
1048
+ expectSyntaxError ( '\uD800\uDC00' ) . to . deep . equal ( {
1049
+ message : 'Syntax Error: Unexpected character: U+10000.' ,
1050
+ locations : [ { line : 1 , column : 1 } ] ,
1051
+ } ) ;
1052
+
1053
+ expectSyntaxError ( '\uDBFF\uDFFF' ) . to . deep . equal ( {
1054
+ message : 'Syntax Error: Unexpected character: U+10FFFF.' ,
1055
+ locations : [ { line : 1 , column : 1 } ] ,
1056
+ } ) ;
1057
+
1043
1058
expectSyntaxError ( '\uDEAD' ) . to . deep . equal ( {
1044
1059
message : 'Syntax Error: Invalid character: U+DEAD.' ,
1045
1060
locations : [ { line : 1 , column : 1 } ] ,
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ function encodeSurrogatePair(point: number): string {
152
152
}
153
153
154
154
function decodeSurrogatePair ( leading : number , trailing : number ) : number {
155
- return 0x10000 | ( ( leading & 0x03ff ) << 10 ) | ( trailing & 0x03ff ) ;
155
+ return 0x10000 + ( ( ( leading & 0x03ff ) << 10 ) | ( trailing & 0x03ff ) ) ;
156
156
}
157
157
158
158
/**
You can’t perform that action at this time.
0 commit comments