File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -207,14 +207,6 @@ function readToken(lexer: Lexer<*>, prev: Token): Token {
207
207
const code = charCodeAt . call ( body , pos ) ;
208
208
209
209
// SourceCharacter
210
- if ( code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d ) {
211
- throw syntaxError (
212
- source ,
213
- pos ,
214
- `Cannot contain the invalid character ${ printCharCode ( code ) } .` ,
215
- ) ;
216
- }
217
-
218
210
switch ( code ) {
219
211
// !
220
212
case 33 :
@@ -353,6 +345,10 @@ function readToken(lexer: Lexer<*>, prev: Token): Token {
353
345
* Report a message that an unexpected character was encountered.
354
346
*/
355
347
function unexpectedCharacterMessage ( code ) {
348
+ if ( code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d ) {
349
+ return `Cannot contain the invalid character ${printCharCode ( code ) } . `;
350
+ }
351
+
356
352
if (code === 39) {
357
353
// '
358
354
return (
@@ -361,7 +357,7 @@ function unexpectedCharacterMessage(code) {
361
357
);
362
358
}
363
359
364
- return ' Cannot parse the unexpected character ' + printCharCode ( code ) + '.' ;
360
+ return ` Cannot parse the unexpected character ${ printCharCode ( code ) } . ` ;
365
361
}
366
362
367
363
/**
You can’t perform that action at this time.
0 commit comments