diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts
index 38faf25da7..3ddc4db1c7 100644
--- a/src/services/navigationBar.ts
+++ b/src/services/navigationBar.ts
@@ -163,6 +163,7 @@ namespace ts.NavigationBar {
// Save the old parent
parentsStack.push(parent);
trackedEs5ClassesStack.push(trackedEs5Classes);
+ trackedEs5Classes = undefined;
parent = navNode;
}
diff --git a/tests/cases/fourslash/navigationBarWithLocalVariables.ts b/tests/cases/fourslash/navigationBarWithLocalVariables.ts
new file mode 100644
index 0000000000..de673d6d9d
--- /dev/null
+++ b/tests/cases/fourslash/navigationBarWithLocalVariables.ts
@@ -0,0 +1,23 @@
+///
+
+//// function x(){
+//// const x = Object()
+//// x.foo = ""
+//// }
+
+verify.navigationTree({
+ "text": "",
+ "kind": "script",
+ "childItems": [
+ {
+ "text": "x",
+ "kind": "function",
+ "childItems": [
+ {
+ "text": "x",
+ "kind": "const"
+ }
+ ]
+ }
+ ]
+});