Skip to content

Commit 7b68421

Browse files
arusakovmhegazy
authored andcommitted
Fix #11545 ('export as namespace foo' occurs EOF without semicolon) (#11797)
1 parent 4dc6028 commit 7b68421

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5472,7 +5472,7 @@ namespace ts {
54725472

54735473
exportDeclaration.name = parseIdentifier();
54745474

5475-
parseExpected(SyntaxKind.SemicolonToken);
5475+
parseSemicolon();
54765476

54775477
return finishNode(exportDeclaration);
54785478
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=== tests/cases/compiler/exportAsNamespace.d.ts ===
2+
// issue: https://github.com/Microsoft/TypeScript/issues/11545
3+
4+
export var X;
5+
>X : Symbol(X, Decl(exportAsNamespace.d.ts, 2, 10))
6+
7+
export as namespace N
8+
>N : Symbol(N, Decl(exportAsNamespace.d.ts, 2, 13))
9+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=== tests/cases/compiler/exportAsNamespace.d.ts ===
2+
// issue: https://github.com/Microsoft/TypeScript/issues/11545
3+
4+
export var X;
5+
>X : any
6+
7+
export as namespace N
8+
>N : typeof N
9+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// issue: https://github.com/Microsoft/TypeScript/issues/11545
2+
3+
export var X;
4+
export as namespace N

0 commit comments

Comments
 (0)