File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ describe('Parser', () => {
75
75
message : 'Syntax Error: Unexpected "...".' ,
76
76
locations : [ { line : 1 , column : 1 } ] ,
77
77
} ) ;
78
+
79
+ expectSyntaxError ( '{ ""' ) . to . deep . include ( {
80
+ message : 'Syntax Error: Expected Name, found String "".' ,
81
+ locations : [ { line : 1 , column : 3 } ] ,
82
+ } ) ;
78
83
} ) ;
79
84
80
85
it ( 'parse provides useful error when using source' , ( ) => {
Original file line number Diff line number Diff line change @@ -1556,9 +1556,8 @@ defineToJSON(Loc, function() {
1556
1556
* A helper function to describe a token as a string for debugging
1557
1557
*/
1558
1558
function getTokenDesc ( token : Token ) : string {
1559
- return (
1560
- getTokenKindDesc ( token . kind ) + ( token . value ? ` "${ token . value } "` : '' )
1561
- ) ;
1559
+ const value = token . value ;
1560
+ return getTokenKindDesc ( token . kind ) + ( value != null ? ` "${ value } "` : '' ) ;
1562
1561
}
1563
1562
1564
1563
/**
You can’t perform that action at this time.
0 commit comments