Skip to content

Commit 775d32a

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

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-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: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @allowJs: true
4+
5+
// @Filename: /a.js
6+
////exports.a = exports.b = exports.c = 0;
7+
8+
verify.navigationTree({
9+
text: "<global>",
10+
kind: "script",
11+
childItems: [
12+
{
13+
text: "a",
14+
kind: "const",
15+
childItems: [
16+
{
17+
text: "b",
18+
kind: "const",
19+
childItems: [{ text: "c", kind: "const" }],
20+
},
21+
],
22+
},
23+
],
24+
});
25+
26+
verify.navigationBar([
27+
{
28+
text: "<global>",
29+
kind: "script",
30+
childItems: [
31+
{ text: "a", kind: "const" },
32+
],
33+
},
34+
]);
35+

0 commit comments

Comments
 (0)