Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
deps: update ChakraCore to chakra-core/ChakraCore@9f40fcb70b
Browse files Browse the repository at this point in the history
[1.8>1.9] [MERGE #4625 @obastemur] xplat-intl: default to non intl compare for localeCompare

Merge pull request #4625 from obastemur:xplat_intl_local_comp

Fixes #4623

Also enabling a test case that only tests the interface.

Reviewed-By: chakrabot <[email protected]>
  • Loading branch information
obastemur authored and kfarnung committed Feb 1, 2018
1 parent bcecf8e commit 55f78ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1380,10 +1380,6 @@ namespace Js
#ifdef _WIN32
// xplat-todo: Need to replace this with platform-agnostic API
compareResult = CompareStringEx(givenLocale != nullptr ? givenLocale : defaultLocale, compareFlags, aLeft, size1, aRight, size2, NULL, NULL, 0);
#else
// FIXME (doilij): when CompareStringEx is implemented in PlatformAgnostic, call that function here
compareResult = 2; // 2 means strings are equal (reasonable default)
#endif

// Get the last error code so that it won't be affected by END_TEMP_ALLOCATOR.
if (compareResult == 0)
Expand All @@ -1400,6 +1396,16 @@ namespace Js
}

JavascriptError::MapAndThrowError(scriptContext, HRESULT_FROM_WIN32(lastError));
#else // _WIN32 (once ICU interface supports this, keep the implementation below for non-icu!)
compareResult = wcsncmp(aLeft, aRight, min(size1, size2));
if (compareResult == 0 && size1 != size2)
{
compareResult = size1 > size2 ? 1 : -1;
}
return JavascriptNumber::ToVar(compareResult, scriptContext);
}
END_TEMP_ALLOCATOR(tempAllocator, scriptContext);
#endif
}

Var IntlEngineInterfaceExtensionObject::EntryIntl_CurrencyDigits(RecyclableObject* function, CallInfo callInfo, ...)
Expand Down
1 change: 0 additions & 1 deletion deps/chakrashim/core/test/Strings/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
<default>
<files>compare.js</files>
<baseline>compare.baseline</baseline>
<compile-flags>-Intl-</compile-flags>
</default>
</test>
<test>
Expand Down

0 comments on commit 55f78ac

Please sign in to comment.