Improve asserts in getSuggestionForNonexistentSymbol
This commit is contained in:
parent
146addc4d5
commit
c6f343e266
|
@ -15291,8 +15291,9 @@ namespace ts {
|
|||
}
|
||||
|
||||
function getSuggestionForNonexistentSymbol(location: Node, outerName: __String, meaning: SymbolFlags): string {
|
||||
Debug.assert(outerName !== undefined, "outername should always be defined");
|
||||
const result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, (symbols, name, meaning) => {
|
||||
Debug.assert(name !== undefined, "name should always be defined, and equal to " + outerName);
|
||||
Debug.assertEqual(outerName, name, "name should equal outerName");
|
||||
const symbol = getSymbol(symbols, name, meaning);
|
||||
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
|
||||
// So the table *contains* `x` but `x` isn't actually in scope.
|
||||
|
|
Loading…
Reference in a new issue