Skip to content

Commit 9e42eb8

Browse files
author
Andy Hanson
committed
navigationBar: Avoid double recursion on special property assignment
1 parent 03fff50 commit 9e42eb8

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/services/navigationBar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ namespace ts.NavigationBar {
277277
case SpecialPropertyAssignmentKind.PrototypeProperty:
278278
case SpecialPropertyAssignmentKind.Prototype:
279279
addNodeWithRecursiveChild(node, (node as BinaryExpression).right);
280-
break;
280+
return;
281281
case SpecialPropertyAssignmentKind.ThisProperty:
282282
case SpecialPropertyAssignmentKind.Property:
283283
case SpecialPropertyAssignmentKind.None:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @allowJs: true
4+
5+
// @Filename: /a.js
6+
////exports.a = exports.b = exports.c = 0;
7+
8+
//TODO: There should be no childItems of consts
9+
verify.navigationTree({
10+
text: "<global>",
11+
kind: "script",
12+
childItems: [
13+
{
14+
text: "a",
15+
kind: "const",
16+
childItems: [
17+
{
18+
text: "b",
19+
kind: "const",
20+
childItems: [{ text: "c", kind: "const" }],
21+
},
22+
],
23+
},
24+
],
25+
});
26+
27+
verify.navigationBar([
28+
{
29+
text: "<global>",
30+
kind: "script",
31+
childItems: [
32+
{ text: "a", kind: "const" },
33+
],
34+
},
35+
]);
36+

0 commit comments

Comments
 (0)