Fix location/range on TypeScript ExportNamedDeclarations (#9406)

This commit is contained in:
Brian Ng
2019-01-24 19:44:22 -06:00
committed by GitHub
parent 854313a759
commit 7dc157f9be
6 changed files with 91 additions and 27 deletions

View File

@@ -114,12 +114,12 @@
"source": null,
"declaration": {
"type": "TSInterfaceDeclaration",
"start": 42,
"start": 34,
"end": 56,
"loc": {
"start": {
"line": 2,
"column": 15
"column": 7
},
"end": {
"line": 2,

View File

@@ -47,12 +47,12 @@
"source": null,
"declaration": {
"type": "TSEnumDeclaration",
"start": 15,
"start": 7,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 15
"column": 7
},
"end": {
"line": 1,

View File

@@ -5,3 +5,4 @@ export declare interface I {}
export declare type T = number;
export declare module M {}
export declare namespace N {}
export declare enum foo {}

View File

@@ -1,29 +1,29 @@
{
"type": "File",
"start": 0,
"end": 211,
"end": 238,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 7,
"column": 29
"line": 8,
"column": 26
}
},
"program": {
"type": "Program",
"start": 0,
"end": 211,
"end": 238,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 7,
"column": 29
"line": 8,
"column": 26
}
},
"sourceType": "module",
@@ -47,12 +47,12 @@
"source": null,
"declaration": {
"type": "VariableDeclaration",
"start": 15,
"start": 7,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 15
"column": 7
},
"end": {
"line": 1,
@@ -146,12 +146,12 @@
"source": null,
"declaration": {
"type": "TSDeclareFunction",
"start": 47,
"start": 39,
"end": 66,
"loc": {
"start": {
"line": 2,
"column": 15
"column": 7
},
"end": {
"line": 2,
@@ -229,12 +229,12 @@
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 82,
"start": 74,
"end": 92,
"loc": {
"start": {
"line": 3,
"column": 15
"column": 7
},
"end": {
"line": 3,
@@ -296,12 +296,12 @@
"source": null,
"declaration": {
"type": "TSInterfaceDeclaration",
"start": 108,
"start": 100,
"end": 122,
"loc": {
"start": {
"line": 4,
"column": 15
"column": 7
},
"end": {
"line": 4,
@@ -362,12 +362,12 @@
"source": null,
"declaration": {
"type": "TSTypeAliasDeclaration",
"start": 138,
"start": 130,
"end": 154,
"loc": {
"start": {
"line": 5,
"column": 15
"column": 7
},
"end": {
"line": 5,
@@ -427,12 +427,12 @@
"source": null,
"declaration": {
"type": "TSModuleDeclaration",
"start": 170,
"start": 162,
"end": 181,
"loc": {
"start": {
"line": 6,
"column": 15
"column": 7
},
"end": {
"line": 6,
@@ -493,12 +493,12 @@
"source": null,
"declaration": {
"type": "TSModuleDeclaration",
"start": 197,
"start": 189,
"end": 211,
"loc": {
"start": {
"line": 7,
"column": 15
"column": 7
},
"end": {
"line": 7,
@@ -540,6 +540,57 @@
},
"declare": true
}
},
{
"type": "ExportNamedDeclaration",
"start": 212,
"end": 238,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 26
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "TSEnumDeclaration",
"start": 219,
"end": 238,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 26
}
},
"id": {
"type": "Identifier",
"start": 232,
"end": 235,
"loc": {
"start": {
"line": 8,
"column": 20
},
"end": {
"line": 8,
"column": 23
},
"identifierName": "foo"
},
"name": "foo"
},
"members": [],
"declare": true
}
}
],
"directives": []