Remove crashing diagnostic code that wasn't helping us (#36913)

This commit is contained in:
Ryan Cavanaugh 2020-02-27 12:45:28 -08:00 committed by GitHub
parent d33fb87da8
commit 35aea8bbfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -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);
}
}

View File

@ -0,0 +1,10 @@
/// <reference path="fourslash.ts" />
// @allowNonTsExtensions: true
// @Filename: Foo.js
//// /**/module.exports = {
////
//// }
goTo.marker();
verify.occurrencesAtPositionCount(1);