Skip to content

Commit

Permalink
fix: Fix infinite loop on template literals during parse error recove…
Browse files Browse the repository at this point in the history
…ry (#2011)
  • Loading branch information
HerrCai0907 committed Sep 10, 2021
1 parent b652b46 commit b1a5b0f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4296,10 +4296,18 @@ export class Parser extends DiagnosticEmitter {
tn.readIdentifier();
break;
}
case Token.STRINGLITERAL: {
case Token.STRINGLITERAL:{
tn.readString();
break;
}
case Token.TEMPLATELITERAL: {
tn.readString();
while(tn.readingTemplateString){
this.skipBlock(tn);
tn.readString(CharCode.BACKTICK);
}
break;
}
case Token.INTEGERLITERAL: {
tn.readInteger();
tn.checkForIdentifierStartAfterNumericLiteral();
Expand Down

0 comments on commit b1a5b0f

Please sign in to comment.