From 35aea8bbfa0145a99fc70f84d08a1ef6b380358a Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 27 Feb 2020 12:45:28 -0800 Subject: [PATCH] Remove crashing diagnostic code that wasn't helping us (#36913) --- src/services/importTracker.ts | 4 ---- tests/cases/fourslash/emptyExportFindReferences.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 tests/cases/fourslash/emptyExportFindReferences.ts diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index 74ded3d69a4..91b53ea418a 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -518,10 +518,6 @@ namespace ts.FindAllReferences { } const sym = useLhsSymbol ? checker.getSymbolAtLocation(getNameOfAccessExpression(cast(node.left, isAccessExpression))) : symbol; - // Better detection for GH#20803 - if (sym && !(checker.getMergedSymbol(sym.parent!).flags & SymbolFlags.Module)) { - Debug.fail(`Special property assignment kind does not have a module as its parent. Assignment is ${Debug.formatSymbol(sym)}, parent is ${Debug.formatSymbol(sym.parent!)}`); - } return sym && exportInfo(sym, kind); } } diff --git a/tests/cases/fourslash/emptyExportFindReferences.ts b/tests/cases/fourslash/emptyExportFindReferences.ts new file mode 100644 index 00000000000..84995a2ae93 --- /dev/null +++ b/tests/cases/fourslash/emptyExportFindReferences.ts @@ -0,0 +1,10 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: Foo.js +//// /**/module.exports = { +//// +//// } + +goTo.marker(); +verify.occurrencesAtPositionCount(1); \ No newline at end of file