Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle colon token
  • Loading branch information
a-tarasyuk committed May 26, 2025
commit 3ef51f53e00598f2e1cb6c2fea64d89812882aa8
2 changes: 1 addition & 1 deletion src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7330,7 +7330,7 @@ namespace Parser {

function nextTokenIsEqualsOrSemicolonToken() {
nextToken();
return token() === SyntaxKind.EqualsToken || token() === SyntaxKind.SemicolonToken;
return token() === SyntaxKind.EqualsToken || token() === SyntaxKind.SemicolonToken || token() === SyntaxKind.ColonToken;
}

function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf?: boolean) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
usingDeclarationsInForOf.4.ts(2,12): error TS1155: 'using' declarations must be initialized.
usingDeclarationsInForOf.4.ts(3,12): error TS1155: 'using' declarations must be initialized.


==== usingDeclarationsInForOf.4.ts (1 errors) ====
for (using of = null;;) break;
for (using of: null = null;;) break;
for (using of;;) break;
~~
!!! error TS1155: 'using' declarations must be initialized.
Expand Down
3 changes: 3 additions & 0 deletions tests/baselines/reference/usingDeclarationsInForOf.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

//// [usingDeclarationsInForOf.4.ts]
for (using of = null;;) break;
for (using of: null = null;;) break;
for (using of;;) break;


//// [usingDeclarationsInForOf.4.js]
for (using of = null;;)
break;
for (using of = null;;)
break;
for (using of;;)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
// @noTypesAndSymbols: true

for (using of = null;;) break;
for (using of: null = null;;) break;
for (using of;;) break;