Skip to content

Commit f012159

Browse files
author
Andy Hanson
committed
Revert previous commit
1 parent cc5b103 commit f012159

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/services/navigationBar.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ namespace ts.NavigationBar {
140140
function sortNodes(nodes: Node[]): Node[] {
141141
return nodes.slice(0).sort((n1: Declaration, n2: Declaration) => {
142142
if (n1.name && n2.name) {
143-
return localeCompareFix(getPropertyNameForPropertyNameNode(n1.name), getPropertyNameForPropertyNameNode(n2.name));
143+
return getPropertyNameForPropertyNameNode(n1.name).localeCompare(getPropertyNameForPropertyNameNode(n2.name));
144144
}
145145
else if (n1.name) {
146146
return 1;
@@ -152,16 +152,6 @@ namespace ts.NavigationBar {
152152
return n1.kind - n2.kind;
153153
}
154154
});
155-
156-
// node 0.10 treats "a" as greater than "B".
157-
// For consistency, sort alphabetically, falling back to which is lower-case.
158-
function localeCompareFix(a: string, b: string) {
159-
const cmp = a.toLowerCase().localeCompare(b.toLowerCase());
160-
if (cmp !== 0)
161-
return cmp;
162-
// Return the *opposite* of the `<` operator, which works the same in node 0.10 and 6.0.
163-
return a < b ? 1 : a > b ? -1 : 0;
164-
}
165155
}
166156

167157
function addTopLevelNodes(nodes: Node[], topLevelNodes: Node[]): void {

0 commit comments

Comments
 (0)