From 0db07e5828b2d5ed98299234d451dd7e5f732414 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 11 Jun 2018 17:50:25 -0700 Subject: [PATCH] Use correct search order for position location (#24886) (#24888) --- src/services/sourcemaps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index c24ed0f64a8..8ebc8375024 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -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) { @@ -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) {