Skip to content

Commit

Permalink
Use correct search order for position location (#24886) (#24888)
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Jun 12, 2018
1 parent 8b3fe2d commit 0db07e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/sourcemaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace ts.sourcemaps {
};

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

function getOriginalPosition(loc: SourceMappableLocation): SourceMappableLocation {
const maps = getSourceOrderedMappings();
const maps = getGeneratedOrderedMappings();
if (!length(maps)) return loc;
let targetIndex = binarySearch(maps, { emittedPosition: loc.position }, identity, compareProcessedPositionEmittedPositions);
if (targetIndex < 0 && maps.length > 0) {
Expand Down

0 comments on commit 0db07e5

Please sign in to comment.