navigationBar: Avoid double recursion on special property assignment (#25077)

This commit is contained in:
Andy 2018-06-20 12:57:34 -07:00 committed by GitHub
parent 1c3259d29b
commit f3e2e891da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 1 deletions

View file

@ -277,7 +277,7 @@ namespace ts.NavigationBar {
case SpecialPropertyAssignmentKind.PrototypeProperty:
case SpecialPropertyAssignmentKind.Prototype:
addNodeWithRecursiveChild(node, (node as BinaryExpression).right);
break;
return;
case SpecialPropertyAssignmentKind.ThisProperty:
case SpecialPropertyAssignmentKind.Property:
case SpecialPropertyAssignmentKind.None:

View file

@ -0,0 +1,35 @@
/// <reference path="fourslash.ts" />
// @allowJs: true
// @Filename: /a.js
////exports.a = exports.b = exports.c = 0;
verify.navigationTree({
text: "<global>",
kind: "script",
childItems: [
{
text: "a",
kind: "const",
childItems: [
{
text: "b",
kind: "const",
childItems: [{ text: "c", kind: "const" }],
},
],
},
],
});
verify.navigationBar([
{
text: "<global>",
kind: "script",
childItems: [
{ text: "a", kind: "const" },
],
},
]);