Skip to content

Commit 212cd9b

Browse files
authored
Use correct search order for position location (microsoft#24886)
1 parent 6c78ce3 commit 212cd9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/sourcemaps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace ts.sourcemaps {
4242
};
4343

4444
function getGeneratedPosition(loc: SourceMappableLocation): SourceMappableLocation {
45-
const maps = getGeneratedOrderedMappings();
45+
const maps = getSourceOrderedMappings();
4646
if (!length(maps)) return loc;
4747
let targetIndex = binarySearch(maps, { sourcePath: loc.fileName, sourcePosition: loc.position }, identity, compareProcessedPositionSourcePositions);
4848
if (targetIndex < 0 && maps.length > 0) {
@@ -56,7 +56,7 @@ namespace ts.sourcemaps {
5656
}
5757

5858
function getOriginalPosition(loc: SourceMappableLocation): SourceMappableLocation {
59-
const maps = getSourceOrderedMappings();
59+
const maps = getGeneratedOrderedMappings();
6060
if (!length(maps)) return loc;
6161
let targetIndex = binarySearch(maps, { emittedPosition: loc.position }, identity, compareProcessedPositionEmittedPositions);
6262
if (targetIndex < 0 && maps.length > 0) {

0 commit comments

Comments
 (0)