mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 12:32:08 -06:00
Use correct search order for position location (#24886)
This commit is contained in:
parent
6c78ce31ea
commit
212cd9b218
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user