From bab866ac0f36b335173c706a9ec5a5543951cbf5 Mon Sep 17 00:00:00 2001 From: Doug Ilijev Date: Tue, 31 Jul 2018 12:23:58 -0700 Subject: [PATCH] Revert overzealous failfast logic which tried to improve detection of i18n initialization issues See OS#10368428 See original PR #5375 --- lib/Parser/CharClassifier.cpp | 8 +++++++- .../Platform/Windows/UnicodeText.cpp | 16 +--------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/Parser/CharClassifier.cpp b/lib/Parser/CharClassifier.cpp index 28fe684cf62..b8f942dc754 100644 --- a/lib/Parser/CharClassifier.cpp +++ b/lib/Parser/CharClassifier.cpp @@ -411,7 +411,12 @@ Js::CharClassifier::CharClassifier(void) bool isES6UnicodeModeEnabled = CONFIG_FLAG(ES6Unicode); bool isFullUnicodeSupportAvailable = PlatformAgnostic::UnicodeText::IsExternalUnicodeLibraryAvailable(); -#if INTL_ICU || INTL_WINGLOB // don't assert in _no_icu builds (where there is no i18n library, by design) +// The following assertions are intentionally excluded from ChakraCore by guarding on NTBUILD. +// This is to work around limitations of the i18n library downlevel (Win7, Win 8.0) +// where CharClassifier functionality is not available. +// TODO: Ideally, we would use the following guard instead to assert when an i18n library is available: +// #if INTL_ICU || INTL_WINGLOB +#ifdef NTBUILD AssertMsg(isFullUnicodeSupportAvailable, "Windows.Globalization needs to present with IUnicodeCharacterStatics support for Chakra.dll to work"); if (!isFullUnicodeSupportAvailable) { @@ -450,6 +455,7 @@ Js::CharClassifier::CharClassifier(void) getBigCharFlagsFunc = &CharClassifier::GetBigCharFlagsES5; } #endif + } const OLECHAR* Js::CharClassifier::SkipWhiteSpaceNonSurrogate(LPCOLESTR psz, const CharClassifier *instance) diff --git a/lib/Runtime/PlatformAgnostic/Platform/Windows/UnicodeText.cpp b/lib/Runtime/PlatformAgnostic/Platform/Windows/UnicodeText.cpp index c26cb82b036..454aa68b8a4 100644 --- a/lib/Runtime/PlatformAgnostic/Platform/Windows/UnicodeText.cpp +++ b/lib/Runtime/PlatformAgnostic/Platform/Windows/UnicodeText.cpp @@ -416,23 +416,9 @@ namespace PlatformAgnostic { return true; } -#if INTL_ICU || INTL_WINGLOB // don't assert in _no_icu builds (where there is no i18n library, by design) - else - { - // did not find winGlobCharApi - Js::Throw::FatalInternalGlobalizationError(); - } - } - else - { - // failed to initialize Windows Globalization - Js::Throw::FatalInternalGlobalizationError(); -#endif } -#if (INTL_ICU || INTL_WINGLOB) && !defined(DBG) - return false; // in debug builds, this is unreachable code -#endif + return false; }, false); } #endif // HAS_ICU