mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Fix tests for node 11 (#28108)
1. Sort is now stable in node 11, which exposed a lack in the sorting of nested ranges. Ranges now sort based on last ending if the start positions are the same. This means nested ranges sort the containing range first, even if a range contains another range that starts at the same position. 2. Symbol has a new member description which can't be accessed through the prototype. In addition, Array now has flat and flatMap, which I excluded to keep baselines the same between Node 6-11.
This commit is contained in:
committed by
GitHub
parent
ff6f94791f
commit
0db3038b57
@@ -3846,7 +3846,7 @@ ${code}
|
||||
}
|
||||
|
||||
// put ranges in the correct order
|
||||
localRanges = localRanges.sort((a, b) => a.pos < b.pos ? -1 : 1);
|
||||
localRanges = localRanges.sort((a, b) => a.pos < b.pos ? -1 : a.pos === b.pos && a.end > b.end ? -1 : 1);
|
||||
localRanges.forEach((r) => { ranges.push(r); });
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user