Skip to content

Commit 8aab971

Browse files
committed
fix
1 parent 3fc00f7 commit 8aab971

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/tokenizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ export class Tokenizer extends DiagnosticEmitter {
16141614
checkForIdentifierStartAfterNumericLiteral(): void {
16151615
// TODO: BigInt n
16161616
var pos = this.pos;
1617-
if (pos + 1 < this.end && isIdentifierStart(this.source.text.charCodeAt(pos))) {
1617+
if (pos < this.end && isIdentifierStart(this.source.text.charCodeAt(pos))) {
16181618
this.error(
16191619
DiagnosticCode.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal,
16201620
this.range(pos)

tests/parser/literals.ts.fixture.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,4 @@ b;
8181
// ERROR 1109: "Expression expected." in literals.ts(68,3+1)
8282
// ERROR 6188: "Numeric separators are not allowed here." in literals.ts(70,2+0)
8383
// ERROR 1351: "An identifier or keyword cannot immediately follow a numeric literal." in literals.ts(71,3+0)
84-
// ERROR 1351: "An identifier or keyword cannot immediately follow a numeric literal." in literals.ts(71,3+0)
85-
// ERROR 1351: "An identifier or keyword cannot immediately follow a numeric literal." in literals.ts(72,4+0)
8684
// ERROR 1351: "An identifier or keyword cannot immediately follow a numeric literal." in literals.ts(72,4+0)

0 commit comments

Comments
 (0)