File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ namespace ts.NavigationBar {
324
324
}
325
325
326
326
// More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times.
327
- const collator : { compare ( a : string , b : string ) : number } = typeof Intl === "undefined" ? undefined : new Intl . Collator ( ) ;
327
+ const collator : { compare ( a : string , b : string ) : number } = typeof Intl === "object" && typeof Intl . Collator === "function" ? new Intl . Collator ( ) : undefined ;
328
328
// Intl is missing in Safari, and node 0.10 treats "a" as greater than "B".
329
329
const localeCompareIsCorrect = collator && collator . compare ( "a" , "B" ) < 0 ;
330
330
const localeCompareFix : ( a : string , b : string ) => number = localeCompareIsCorrect ? collator . compare : function ( a , b ) {
You can’t perform that action at this time.
0 commit comments