Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Build/Chakra.Build.Default.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,20 @@
<EnableIntl Condition="'$(EnableIntl)'==''">true</EnableIntl>
<EnableIntl Condition="'$(BuildLite)'=='true'">false</EnableIntl>

<ChakraICU Condition="'$(ChakraICU)'==''">false</ChakraICU>
<ChakraICU Condition="'$(ChakraICU)'==''">windows</ChakraICU>

<BuildChakraICUData Condition="'$(BuildChakraICUData)'=='' AND ('$(ChakraICU)'=='static' OR '$(ChakraICU)'=='shared')">true</BuildChakraICUData>
</PropertyGroup>

<PropertyGroup Condition=" '$(ChakraICU)' == 'windows' ">
<_UseModernWindowsIcu Condition=" Exists('$(SYSTEMROOT)\System32\icu.dll') ">true</_UseModernWindowsIcu>

<IcuLibraryDependencies Condition="'$(ChakraICU)'=='windows'">icuuc.lib;icuin.lib</IcuLibraryDependencies>
<IcuLibraryDependencies Condition=" '$(_UseModernWindowsIcu)' == 'true' ">icu.lib</IcuLibraryDependencies>
<IcuLibraryDependencies Condition=" '$(_UseModernWindowsIcu)' != 'true' ">icuuc.lib;icuin.lib</IcuLibraryDependencies>
</PropertyGroup>

<Target Name="CheckIcuDependency" Condition=" '$(ChakraICU)' == 'windows' " BeforeTargets="Build">
<Warning Condition=" '$(_UseModernWindowsIcu)' != 'true' " Code="CCICU001" Text="You are compiling against an old version of libicu." />
</Target>

</Project>
22 changes: 11 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,71 +125,71 @@ jobs:
maxParallel: 4
matrix:
x86.Debug:
image_name: 'windows-2022'
image_name: 'windows-2025'
build_type: 'debug'
target: 'x86'
special_build: ''
do_test: true
test_tags: ''
build_outdir_suffix: ''
x86.Test:
image_name: 'windows-2022'
image_name: 'windows-2025'
build_type: 'test'
target: 'x86'
special_build: ''
do_test: true
test_tags: '--include-slow'
build_outdir_suffix: ''
x86.NoJit:
image_name: 'windows-2022'
image_name: 'windows-2025'
build_type: 'debug'
target: 'x86'
special_build: '"/p:BuildJIT=false"'
do_test: true
test_tags: '-disablejit'
build_outdir_suffix: '.NoJIT'
x86.Release:
image_name: 'windows-2022'
image_name: 'windows-2025'
build_type: 'release'
target: 'x86'
special_build: ''
do_test: false
test_tags: ''
build_outdir_suffix: ''
x64.Debug:
image_name: 'windows-2022'
image_name: 'windows-2025'
build_type: 'debug'
target: 'x64'
special_build: ''
do_test: true
test_tags: ''
build_outdir_suffix: ''
x64.Test:
image_name: 'windows-2022'
image_name: 'windows-2025'
build_type: 'test'
target: 'x64'
special_build: ''
do_test: true
test_tags: '--include-slow'
build_outdir_suffix: ''
x64.Release:
image_name: 'windows-2022'
image_name: 'windows-2025'
build_type: 'release'
target: 'x64'
special_build: ''
do_test: false
test_tags: ''
build_outdir_suffix: ''
win19.x86.Release:
image_name: 'windows-2019'
win22.x86.Release:
image_name: 'windows-2022'
build_type: 'release'
target: 'x86'
special_build: ''
do_test: false
test_tags: ''
build_outdir_suffix: ''
win19.x64.Release:
image_name: 'windows-2019'
win22.x64.Release:
image_name: 'windows-2022'
build_type: 'release'
target: 'x64'
special_build: ''
Expand Down
7 changes: 5 additions & 2 deletions lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,8 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
return JavascriptString::NewWithBuffer(formatted, formattedLen, scriptContext);
}

#if defined(ICU_VERSION) && ICU_VERSION >= 61
// windows-icu does not define `ICU_VERSION` but does support `unum_formatDoubleForFields` (ICU 61+) since Windows 10 1809 "Redstone 5" (`NTDDI_WIN10_RS5`).
#if !defined(ICU_VERSION) || ICU_VERSION >= 61
Comment thread
ShortDevelopment marked this conversation as resolved.
UErrorCode status = U_ZERO_ERROR;
ScopedUFieldPositionIterator fpi(ufieldpositer_open(&status));

Expand Down Expand Up @@ -3012,7 +3013,9 @@ DEFINE_ISXLOCALEAVAILABLE(PR, uloc)
// For ICU < 61, we can fake it by creating an array of ["other"], which
// uplrules_getKeywords is guaranteed to return at minimum.
// This array is only used in resolved options, so the majority of the functionality can remain (namely, select() still works)
#if defined(ICU_VERSION) && ICU_VERSION >= 61
//
// windows-icu does not define `ICU_VERSION` but does support `uplrules_getKeywords` (ICU 61+) since Windows 10 1809 "Redstone 5" (`NTDDI_WIN10_RS5`).
#if !defined(ICU_VERSION) || ICU_VERSION >= 61
DynamicObject *state = UnsafeVarTo<DynamicObject>(args[1]);
FinalizableUPluralRules *pr = GetOrCreateCachedUPluralRules(state, scriptContext);

Expand Down
2 changes: 0 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ endif ()

if (NO_ICU)
set(TEST_ICU --not-tag exclude_noicu)
elseif (NOT EMBED_ICU)
set(TEST_ICU --not-tag exclude_icu62AndAboveTestFailures)
Comment thread
ShortDevelopment marked this conversation as resolved.
endif()

if (BuildJIT)
Expand Down
48 changes: 39 additions & 9 deletions test/DebuggerCommon/ES6_intl_simple_attach.js.dbg.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"#__proto__": "Object {...}",
"constructor": "function <large string>",
"resolvedOptions": "function <large string>",
"compare": "function <large string>"
"compare": "Error <large string>"
Comment thread
ShortDevelopment marked this conversation as resolved.
},
"length": "number 0",
"name": "string Collator",
Expand Down Expand Up @@ -281,7 +281,8 @@
"#__proto__": "Object {...}",
"constructor": "function <large string>",
"resolvedOptions": "function <large string>",
"format": "function <large string>"
"format": "Error <large string>",
"formatToParts": "function <large string>"
},
"length": "number 0",
"name": "string NumberFormat",
Expand Down Expand Up @@ -323,6 +324,23 @@
"arguments": "Error <large string>"
},
"length": "number 1"
},
"formatToParts": {
"#__proto__": {
"#__proto__": "Object {...}",
"constructor": "function <large string>",
"length": "number 0",
"name": "string ",
"apply": "function <large string>",
"bind": "function <large string>",
"call": "function <large string>",
"toString": "function <large string>",
"Symbol.hasInstance": "function <large string>",
"caller": "Error <large string>",
"arguments": "Error <large string>"
},
"length": "number 1",
"name": "string formatToParts"
}
}
}
Expand Down Expand Up @@ -430,17 +448,12 @@
"prototype": {
"#__proto__": "Object {...}",
"constructor": "function <large string>",
"format": "function <large string>",
"format": "Error <large string>",
"formatToParts": "function <large string>",
"resolvedOptions": "function <large string>"
},
"length": "number 0",
"name": "string DateTimeFormat",
"__relevantExtensionKeys": {
"#__proto__": "Array []",
"length": "number 2",
"[0]": "string \"ca\"",
"[1]": "string \"nu\""
},
"supportedLocalesOf": {
"#__proto__": "function <large string>",
"length": "number 1",
Expand All @@ -463,6 +476,23 @@
},
"length": "number 1"
},
"formatToParts": {
"#__proto__": {
"#__proto__": "Object {...}",
"constructor": "function <large string>",
"length": "number 0",
"name": "string ",
"apply": "function <large string>",
"bind": "function <large string>",
"call": "function <large string>",
"toString": "function <large string>",
"Symbol.hasInstance": "function <large string>",
"caller": "Error <large string>",
"arguments": "Error <large string>"
},
"length": "number 1",
"name": "string formatToParts"
},
"resolvedOptions": {
"#__proto__": {
"#__proto__": "Object {...}",
Expand Down
3 changes: 1 addition & 2 deletions test/DebuggerCommon/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@
<files>ES6_intl_simple_attach.js</files>
<compile-flags>-dbgbaseline:ES6_intl_simple_attach.js.dbg.baseline -Intl</compile-flags>
<baseline>ES6_intl_simple_attach.js.baseline</baseline>
<!-- This test is still require_winglob because it has winglob-specific output in the .dbg.baseline -->
<tags>Intl,require_winglob</tags>
<tags>Intl</tags>
</default>
</test>
<test>
Expand Down
23 changes: 17 additions & 6 deletions test/Intl/GetCanonicalLocales.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -90,18 +91,24 @@ var tests = [
// V8 and CC-ICU also give the default value of "yes" to non-boolean keys (co), which also is incorrect.
// Everyone (should) correctly re-order extension keys alphabetically
// Microsoft/ChakraCore#4490 tracks the incorrect defaulting, Microsoft/ChakraCore#2964 tracks the overall investigation
equal("de-DE-u-co-kn", "de-DE-u-co-yes-kn-true", gcl("de-de-u-kn-co")[0]);
equal("de-DE-u-co-phonebk-kn", "de-DE-u-co-phonebk-kn-true", gcl("de-de-u-kn-co-phonebk")[0]);
equal("de-DE-u-co-phonebk-kn-yes", "de-DE-u-co-phonebk-kn-true", gcl("de-DE-u-kn-yes-co-phonebk")[0]);
if (WScript.Platform.ICU_VERSION < 62) {
Comment thread
ShortDevelopment marked this conversation as resolved.
assert.areEqual(["de-DE-u-co-yes-kn-true"], Intl.getCanonicalLocales("de-de-u-kn-co"))
assert.areEqual(["de-DE-u-co-phonebk-kn-true"], Intl.getCanonicalLocales("de-de-u-kn-co-phonebk"))
assert.areEqual(["de-DE-u-co-phonebk-kn-true"], Intl.getCanonicalLocales("de-DE-u-kn-yes-co-phonebk"))
} else {
assert.areEqual(["de-DE-u-co-kn"], Intl.getCanonicalLocales("de-de-u-kn-co"))
assert.areEqual(["de-DE-u-co-phonebk-kn"], Intl.getCanonicalLocales("de-de-u-kn-co-phonebk"))
assert.areEqual(["de-DE-u-co-phonebk-kn"], Intl.getCanonicalLocales("de-DE-u-kn-yes-co-phonebk"))
}

// De-dupe after locales are canonicalized
assert.areEqual(Intl.getCanonicalLocales(['en-us', 'en-us']), ['en-US'], "No duplicates, same input casing (casing was incorrect)");
assert.areEqual(Intl.getCanonicalLocales(['en-US', 'en-US']), ['en-US'], "No duplicates, same input casing (casing was correct)");
assert.areEqual(Intl.getCanonicalLocales(['en-us', 'en-US']), ['en-US'], "No duplicates, different input casing");

assert.areEqual(
["de-DE", "de-DE-u-co-phonebk-kn"],
Intl.getCanonicalLocales(["de-de", "de-DE-u-co-phonebk-kn-true", "de-DE-u-kn-true-co-phonebk"]),
["de-DE", "de-DE-u-co-phonebk-kn-true"],
"No duplicates after re-ordering options"
);
}
Expand All @@ -122,8 +129,12 @@ var tests = [
// TODO (doilij): Investigate what is correct/allowable here (Microsoft/ChakraCore#2964)
equal("xx-zzz", "zzz", gcl("xx-zzz")[0]);

// See discussion of defaulting above (V8/CC-ICU and CC-WinGlob/SM distinction remains true here)
equal("xx-ZZ-u-yy-zz", "xx-ZZ-u-yy-yes-zz-yes", gcl("xx-zz-u-zz-yy")[0]);
// See discussion of defaulting above
if (WScript.Platform.ICU_VERSION < 62) {
assert.areEqual(["xx-ZZ-u-yy-yes-zz-yes"], Intl.getCanonicalLocales("xx-zz-u-zz-yy"));
} else {
assert.areEqual(["xx-ZZ-u-yy-zz"], Intl.getCanonicalLocales("xx-zz-u-zz-yy"));
}
}
},
{
Expand Down
Loading