Skip to content

Commit 3c3bb27

Browse files
committed
Fix a corner case
1 parent a6b40db commit 3c3bb27

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/parser.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3634,9 +3634,6 @@ export class Parser extends DiagnosticEmitter {
36343634
tn.skip(Token.CLOSEBRACE);
36353635
token = tn.next();
36363636
if (token == Token.TEMPLATELITERAL) {
3637-
tn.skip(Token.TEMPLATELITERAL);
3638-
tn.advance();
3639-
tn.inStringTemplate = false;
36403637
break;
36413638
}
36423639
if (token == Token.DOLLAR) {
@@ -3646,6 +3643,10 @@ export class Parser extends DiagnosticEmitter {
36463643
parts.push(this.parseStringLiteral(tn, startPos, CharCode.BACKTICK));
36473644
token = tn.next();
36483645
}
3646+
if (token == Token.TEMPLATELITERAL) {
3647+
tn.advance();
3648+
tn.inStringTemplate = false;
3649+
}
36493650
if (parts.length == 1) {
36503651
return parts[0];
36513652
}

src/tokenizer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,7 @@ export class Tokenizer extends DiagnosticEmitter {
10421042
}
10431043

10441044
advance() {
1045+
this.nextToken = -1;
10451046
++this.pos;
10461047
}
10471048

0 commit comments

Comments
 (0)