From a83a692c40dabf3c813a329737c1574dea74403b Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Thu, 29 Sep 2016 16:52:45 -0700 Subject: [PATCH] Fix 11110: this is to address how Chakra load globalization dll --- src/services/navigationBar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index dda9ef485d2..1e73419b1d4 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -326,7 +326,7 @@ namespace ts.NavigationBar { } // More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times. - const collator: { compare(a: string, b: string): number } = typeof Intl === "undefined" ? undefined : new Intl.Collator(); + const collator: { compare(a: string, b: string): number } = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined; // Intl is missing in Safari, and node 0.10 treats "a" as greater than "B". const localeCompareIsCorrect = collator && collator.compare("a", "B") < 0; const localeCompareFix: (a: string, b: string) => number = localeCompareIsCorrect ? collator.compare : function(a, b) {