mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 01:33:15 -05:00
Add a check to make sure we have results.
This commit is contained in:
@@ -3573,14 +3573,16 @@ module ts {
|
||||
|
||||
function getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] {
|
||||
let results = getOccurrencesAtPositionCore(fileName, position);
|
||||
|
||||
if (results) {
|
||||
let sourceFile = getCanonicalFileName(normalizeSlashes(fileName));
|
||||
|
||||
let sourceFile = getCanonicalFileName(normalizeSlashes(fileName));
|
||||
|
||||
// ensure the results are in the file we're interested in
|
||||
results.forEach((value) => {
|
||||
let targetFile = getCanonicalFileName(normalizeSlashes(value.fileName));
|
||||
Debug.assert(sourceFile == targetFile, `Unexpected file in results. Found results in ${targetFile} expected only results in ${sourceFile}.`);
|
||||
});
|
||||
// ensure the results are in the file we're interested in
|
||||
results.forEach((value) => {
|
||||
let targetFile = getCanonicalFileName(normalizeSlashes(value.fileName));
|
||||
Debug.assert(sourceFile == targetFile, `Unexpected file in results. Found results in ${targetFile} expected only results in ${sourceFile}.`);
|
||||
});
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user