Skip to content

Commit 7b9c916

Browse files
committed
[MERGE #4217 @jackhorton] Intl-ICU on release/1.7 fixups
Merge pull request #4217 from jackhorton:fix-mergeback-break This pull supersedes #4187
2 parents 42789b2 + dc0869f commit 7b9c916

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ namespace Js
681681
return scriptContext->GetLibrary()->GetUndefined();
682682
}
683683

684-
JavascriptString* toReturn = nullptr;
684+
Var toReturn = nullptr;
685685
ENTER_PINNED_SCOPE(JavascriptString, localeStrings);
686686
localeStrings = JavascriptString::FromVar(args.Values[1]);
687687
PCWSTR passedLocale = localeStrings->GetSz();
@@ -690,14 +690,16 @@ namespace Js
690690
char16 resolvedLocaleName[ULOC_FULLNAME_CAPACITY] = { 0 };
691691
if (ResolveLocaleBestFit(passedLocale, resolvedLocaleName))
692692
{
693-
return JavascriptString::NewCopySz(resolvedLocaleName, scriptContext);
693+
toReturn = JavascriptString::NewCopySz(resolvedLocaleName, scriptContext);
694694
}
695-
695+
else
696+
{
696697
#ifdef INTL_ICU_DEBUG
697-
Output::Print(_u("Intl::ResolveLocaleBestFit returned false: EntryIntl_ResolveLocaleBestFit returning null to fallback to JS\n"));
698+
Output::Print(_u("Intl::ResolveLocaleBestFit returned false: EntryIntl_ResolveLocaleBestFit returning null to fallback to JS\n"));
698699
#endif
699-
return scriptContext->GetLibrary()->GetNull();
700-
#else
700+
toReturn = scriptContext->GetLibrary()->GetNull();
701+
}
702+
#else // !INTL_ICU
701703
DelayLoadWindowsGlobalization* wgl = scriptContext->GetThreadContext()->GetWindowsGlobalizationLibrary();
702704
WindowsGlobalizationAdapter* wga = GetWindowsGlobalizationAdapter(scriptContext);
703705

@@ -718,10 +720,11 @@ namespace Js
718720

719721
toReturn = JavascriptString::NewCopySz(wgl->WindowsGetStringRawBuffer(*locale, NULL), scriptContext);
720722

723+
#endif
724+
721725
LEAVE_PINNED_SCOPE(); // localeStrings
722726

723727
return toReturn;
724-
#endif
725728
}
726729

727730
Var IntlEngineInterfaceExtensionObject::EntryIntl_GetDefaultLocale(RecyclableObject* function, CallInfo callInfo, ...)

lib/Runtime/Library/JavascriptString.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,12 +1347,20 @@ namespace Js
13471347
EngineInterfaceObject* nativeEngineInterfaceObj = scriptContext->GetLibrary()->GetEngineInterfaceObject();
13481348
if (nativeEngineInterfaceObj)
13491349
{
1350-
IntlEngineInterfaceExtensionObject* intlExtensionObject = static_cast<IntlEngineInterfaceExtensionObject*>(nativeEngineInterfaceObj->GetEngineExtension(EngineInterfaceExtensionKind_Intl));
1350+
IntlEngineInterfaceExtensionObject* intlExtensionObject = static_cast<IntlEngineInterfaceExtensionObject*>(
1351+
nativeEngineInterfaceObj->GetEngineExtension(EngineInterfaceExtensionKind_Intl));
13511352
if (args.Info.Count == 2)
13521353
{
13531354
auto undefined = scriptContext->GetLibrary()->GetUndefined();
13541355
CallInfo toPass(callInfo.Flags, 7);
1355-
return intlExtensionObject->EntryIntl_CompareString(function, toPass, undefined, pThis, pThat, undefined, undefined, undefined, undefined);
1356+
ThreadContext *threadContext = scriptContext->GetThreadContext();
1357+
return threadContext->ExecuteImplicitCall(function, ImplicitCall_Accessor,
1358+
[threadContext, intlExtensionObject, function, toPass, undefined, pThis, pThat]() -> Var
1359+
{
1360+
return CALL_ENTRYPOINT(threadContext, intlExtensionObject->EntryIntl_CompareString,
1361+
function, toPass, undefined, pThis, pThat, undefined, undefined, undefined, undefined);
1362+
}
1363+
);
13561364
}
13571365
else
13581366
{

0 commit comments

Comments
 (0)