Skip to content

Commit

Permalink
[MERGE #5708 @kfarnung] Intl should only early OOM for full builds
Browse files Browse the repository at this point in the history
Merge pull request #5708 from kfarnung:intl

This currently causes a problem in node where `cctest` fails when
trying to access the Intl object to check for a property.

Refs: nodejs/node-chakracore#567
  • Loading branch information
kfarnung committed Sep 18, 2018
2 parents 259f6ca + c27eb77 commit 100d06a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ PROJECTED_ENUMS(PROJECTED_ENUM)
#else
library->AddMember(intlNativeInterfaces, Js::PropertyIds::winglob, library->GetFalse());

#if defined(NTBUILD)
// when using ICU, we can call ulocdata_getCLDRVersion to ensure that ICU is functioning properly before allowing Intl to continue.
// ulocdata_getCLDRVersion will cause the data file to be loaded, and if we don't have enough memory to do so, we can throw OutOfMemory here.
// This is to protect against spurious U_MISSING_RESOURCE_ERRORs and U_FILE_ACCESS_ERRORs coming from early-lifecycle
Expand All @@ -628,6 +629,7 @@ PROJECTED_ENUMS(PROJECTED_ENUM)
}

AssertOrFailFastMsg(U_SUCCESS(status), "ulocdata_getCLDRVersion returned non-OOM failure");
#endif // defined(NTBUILD)
#endif // else !INTL_WINGLOB

intlNativeInterfaces->SetHasNoEnumerableProperties(true);
Expand Down

0 comments on commit 100d06a

Please sign in to comment.