Skip to content

Commit

Permalink
Use correct search order for position location (microsoft#24886)
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Jun 12, 2018
1 parent 271fb83 commit 3978694
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 3978694

Please sign in to comment.