Skip to content

Commit

Permalink
Perform explicit bounds check
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Apr 20, 2022
1 parent 45f8062 commit 37ae03d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/trace-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export class TraceMap implements SourceMap {
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
} else if (bias === LEAST_UPPER_BOUND) index++;

if (index < 0 || index == segments.length) return null;
if (index === -1 || index === segments.length) return null;
return segments[index];
}
}
Expand Down

0 comments on commit 37ae03d

Please sign in to comment.