Skip to content

Commit 84f3df4

Browse files
committed
Create FatalInternalGlobalizationError and make the failfast trigger in ChakraCore.
1 parent 3dbac45 commit 84f3df4

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

lib/Common/Exceptions/Throw.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ namespace Js {
7777
ReportFatalException(NULL, E_FAIL, Fatal_Internal_Error, scenario);
7878
}
7979

80+
void Throw::FatalInternalGlobalizationError()
81+
{
82+
AssertMsg(false, "Failure in initializing Globalization library");
83+
int scenario = 2;
84+
ReportFatalException(NULL, E_FAIL, Fatal_Internal_Error, scenario);
85+
}
86+
8087
void Throw::FatalProjectionError()
8188
{
8289
RaiseException((DWORD)DBG_TERMINATE_PROCESS, EXCEPTION_NONCONTINUABLE, 0, NULL);

lib/Common/Exceptions/Throw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ namespace Js {
2121
static void __declspec(noreturn) InternalError();
2222
static void __declspec(noreturn) FatalInternalError();
2323
static void __declspec(noreturn) FatalInternalErrorEx(int scenario);
24+
static void __declspec(noreturn) FatalInternalGlobalizationError();
25+
2426
static void __declspec(noreturn) FatalProjectionError();
2527
#if ENABLE_JS_REENTRANCY_CHECK
2628
static void __declspec(noreturn) FatalJsReentrancyError();

lib/Parser/CharClassifier.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,11 @@ Js::CharClassifier::CharClassifier(void)
411411
bool isES6UnicodeModeEnabled = CONFIG_FLAG(ES6Unicode);
412412
bool isFullUnicodeSupportAvailable = PlatformAgnostic::UnicodeText::IsExternalUnicodeLibraryAvailable();
413413

414-
#ifdef NTBUILD
415414
AssertMsg(isFullUnicodeSupportAvailable, "Windows.Globalization needs to present with IUnicodeCharacterStatics support for Chakra.dll to work");
416415
if (!isFullUnicodeSupportAvailable)
417416
{
418-
Js::Throw::FatalInternalError();
417+
Js::Throw::FatalInternalGlobalizationError();
419418
}
420-
#endif
421419

422420
// If we're in ES6 mode, and we have full support for Unicode character classification
423421
// from an external library, then use the ES6/Surrogate pair supported versions of the functions
@@ -450,7 +448,6 @@ Js::CharClassifier::CharClassifier(void)
450448
getBigCharFlagsFunc = &CharClassifier::GetBigCharFlagsES5;
451449
}
452450
#endif
453-
454451
}
455452

456453
const OLECHAR* Js::CharClassifier::SkipWhiteSpaceNonSurrogate(LPCOLESTR psz, const CharClassifier *instance)

lib/Runtime/PlatformAgnostic/Platform/Windows/UnicodeText.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,18 +408,16 @@ namespace PlatformAgnostic
408408
{
409409
return true;
410410
}
411-
#ifdef NTBUILD
412411
else
413412
{
414413
// did not find winGlobCharApi
415-
Js::Throw::FatalInternalError();
414+
Js::Throw::FatalInternalGlobalizationError();
416415
}
417416
}
418417
else
419418
{
420419
// failed to initialize Windows Globalization
421-
Js::Throw::FatalInternalError();
422-
#endif
420+
Js::Throw::FatalInternalGlobalizationError();
423421
}
424422

425423
return false;

0 commit comments

Comments
 (0)