Skip to content

Commit ea56522

Browse files
authored
Merge pull request microsoft#11496 from Microsoft/master_port11268_fixChakraLoadDll
[Master] Port fix in PR#11628
2 parents fe32282 + 5ce2280 commit ea56522

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/navigationBar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ namespace ts.NavigationBar {
324324
}
325325

326326
// 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;
328328
// Intl is missing in Safari, and node 0.10 treats "a" as greater than "B".
329329
const localeCompareIsCorrect = collator && collator.compare("a", "B") < 0;
330330
const localeCompareFix: (a: string, b: string) => number = localeCompareIsCorrect ? collator.compare : function(a, b) {

0 commit comments

Comments
 (0)