mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Set correct pos for NamespaceExport (#36794)
* Set correct pos for NamespaceExport * Update tests
This commit is contained in:
@@ -6576,8 +6576,8 @@ namespace ts {
|
||||
return finishNode(node);
|
||||
}
|
||||
|
||||
function parseNamespaceExport(): NamespaceExport {
|
||||
const node = <NamespaceExport>createNode(SyntaxKind.NamespaceExport);
|
||||
function parseNamespaceExport(pos: number): NamespaceExport {
|
||||
const node = <NamespaceExport>createNode(SyntaxKind.NamespaceExport, pos);
|
||||
node.name = parseIdentifier();
|
||||
return finishNode(node);
|
||||
}
|
||||
@@ -6585,9 +6585,10 @@ namespace ts {
|
||||
function parseExportDeclaration(node: ExportDeclaration): ExportDeclaration {
|
||||
node.kind = SyntaxKind.ExportDeclaration;
|
||||
node.isTypeOnly = parseOptional(SyntaxKind.TypeKeyword);
|
||||
const namespaceExportPos = scanner.getStartPos();
|
||||
if (parseOptional(SyntaxKind.AsteriskToken)) {
|
||||
if (parseOptional(SyntaxKind.AsKeyword)) {
|
||||
node.exportClause = parseNamespaceExport();
|
||||
node.exportClause = parseNamespaceExport(namespaceExportPos);
|
||||
}
|
||||
parseExpected(SyntaxKind.FromKeyword);
|
||||
node.moduleSpecifier = parseModuleSpecifier();
|
||||
|
||||
Reference in New Issue
Block a user