Skip to content

Commit 3ef51f5

Browse files
committed
handle colon token
1 parent 5068c2e commit 3ef51f5

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7330,7 +7330,7 @@ namespace Parser {
73307330

73317331
function nextTokenIsEqualsOrSemicolonToken() {
73327332
nextToken();
7333-
return token() === SyntaxKind.EqualsToken || token() === SyntaxKind.SemicolonToken;
7333+
return token() === SyntaxKind.EqualsToken || token() === SyntaxKind.SemicolonToken || token() === SyntaxKind.ColonToken;
73347334
}
73357335

73367336
function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf?: boolean) {

tests/baselines/reference/usingDeclarationsInForOf.4.errors.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
usingDeclarationsInForOf.4.ts(2,12): error TS1155: 'using' declarations must be initialized.
1+
usingDeclarationsInForOf.4.ts(3,12): error TS1155: 'using' declarations must be initialized.
22

33

44
==== usingDeclarationsInForOf.4.ts (1 errors) ====
55
for (using of = null;;) break;
6+
for (using of: null = null;;) break;
67
for (using of;;) break;
78
~~
89
!!! error TS1155: 'using' declarations must be initialized.

tests/baselines/reference/usingDeclarationsInForOf.4.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
//// [usingDeclarationsInForOf.4.ts]
44
for (using of = null;;) break;
5+
for (using of: null = null;;) break;
56
for (using of;;) break;
67

78

89
//// [usingDeclarationsInForOf.4.js]
10+
for (using of = null;;)
11+
break;
912
for (using of = null;;)
1013
break;
1114
for (using of;;)

tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOf.4.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
// @noTypesAndSymbols: true
55

66
for (using of = null;;) break;
7+
for (using of: null = null;;) break;
78
for (using of;;) break;

0 commit comments

Comments
 (0)