Skip to content

Commit 46e135b

Browse files
author
Andy
authored
Fix parsing of qualified name in @Augments (#18914)
1 parent d4cbdc4 commit 46e135b

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

src/compiler/parser.ts

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

66336633
function parsePropertyAccessEntityNameExpression() {
66346634
let node: Identifier | PropertyAccessEntityNameExpression = parseJSDocIdentifierName(/*createIfMissing*/ true);
6635-
while (token() === SyntaxKind.DotToken) {
6635+
while (parseOptional(SyntaxKind.DotToken)) {
66366636
const prop: PropertyAccessEntityNameExpression = createNode(SyntaxKind.PropertyAccessExpression, node.pos) as PropertyAccessEntityNameExpression;
66376637
prop.expression = node;
66386638
prop.name = parseJSDocIdentifierName();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
=== /a.js ===
2+
export class A {}
3+
>A : Symbol(A, Decl(a.js, 0, 0))
4+
5+
=== /b.js ===
6+
import * as a from "./a";
7+
>a : Symbol(a, Decl(b.js, 0, 6))
8+
9+
/** @augments a.A */
10+
class B {}
11+
>B : Symbol(B, Decl(b.js, 0, 25))
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
=== /a.js ===
2+
export class A {}
3+
>A : A
4+
5+
=== /b.js ===
6+
import * as a from "./a";
7+
>a : typeof a
8+
9+
/** @augments a.A */
10+
class B {}
11+
>B : B
12+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// @allowJs: true
2+
// @checkJs: true
3+
// @noEmit: true
4+
5+
// @Filename: /a.js
6+
export class A {}
7+
8+
// @Filename: /b.js
9+
import * as a from "./a";
10+
/** @augments a.A */
11+
class B {}

0 commit comments

Comments
 (0)