Skip to content

Commit 2346ff7

Browse files
srl295targos
authored andcommitted
deps: cherry-pick 2f5da9a from V8 upstream
Original commit message: Fix the uppercasing of U+00E7(ç) and U+00F7(÷) Due to a typo in runtime-i18n.js, 'ç'(U+00E7) was not uppercased while '÷'(U+00F7) was incorrectly uppercased to '×'(U+00D7). Add a comprehensive test for Latin-1 supplemental block (U+00A0 ~ U+00FF). (they're special-cased for speed-up and needs to have a test for the range.). TEST=intl/general/case-mapping BUG=v8:5681 Review-Url: https://codereview.chromium.org/2533033003 Cr-Commit-Position: refs/heads/master@{#41331} PR-URL: #9828 Fixes: #9785 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent bb71ef7 commit 2346ff7

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 4
1313
#define V8_BUILD_NUMBER 500
14-
#define V8_PATCH_LEVEL 47
14+
#define V8_PATCH_LEVEL 48
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/runtime/runtime-i18n.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ inline uint16_t ToASCIIUpper(uint16_t ch) {
931931
inline uint16_t ToLatin1Upper(uint16_t ch) {
932932
DCHECK(ch != 0xDF && ch != 0xB5 && ch != 0xFF);
933933
return ch &
934-
~(((ch >= 'a' && ch <= 'z') || (((ch & 0xE0) == 0xE0) && ch != 0xE7))
934+
~(((ch >= 'a' && ch <= 'z') || (((ch & 0xE0) == 0xE0) && ch != 0xF7))
935935
<< 5);
936936
}
937937

deps/v8/test/intl/general/case-mapping.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,29 @@ assertEquals("\u{10CC0}", "\u{10C80}".toLocaleLowerCase());
136136
assertEquals("\u{10C80}", "\u{10CC0}".toLocaleUpperCase(["tr"]));
137137
assertEquals("\u{10C80}", "\u{10CC0}".toLocaleUpperCase(["tr"]));
138138
assertEquals("\u{10CC0}", "\u{10C80}".toLocaleLowerCase());
139+
140+
// check fast path for Latin-1 supplement (U+00A0 ~ U+00FF)
141+
var latin1Suppl = "\u00A0¡¢£¤¥¦§¨©ª«¬\u00AD®°±²³´µ¶·¸¹º»¼½¾¿" +
142+
"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
143+
var latin1SupplLowercased = "\u00A0¡¢£¤¥¦§¨©ª«¬\u00AD®°±²³´µ¶·¸¹º»¼½¾¿" +
144+
"àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
145+
var latin1SupplUppercased = "\u00A0¡¢£¤¥¦§¨©ª«¬\u00AD®°±²³´\u039C¶·¸¹º»¼½¾¿" +
146+
"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞSSÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞ\u0178";
147+
148+
assertEquals(latin1SupplLowercased, latin1Suppl.toLowerCase());
149+
assertEquals(latin1SupplUppercased, latin1Suppl.toUpperCase());
150+
assertEquals(latin1SupplLowercased, latin1Suppl.toLocaleLowerCase("de"));
151+
assertEquals(latin1SupplUppercased, latin1Suppl.toLocaleUpperCase("de"));
152+
assertEquals(latin1SupplLowercased, latin1Suppl.toLocaleLowerCase("el"));
153+
assertEquals(latin1SupplUppercased, latin1Suppl.toLocaleUpperCase("el"));
154+
assertEquals(latin1SupplUppercased, latin1Suppl.toLocaleUpperCase("tr"));
155+
assertEquals(latin1SupplLowercased, latin1Suppl.toLocaleLowerCase("tr"));
156+
assertEquals(latin1SupplUppercased, latin1Suppl.toLocaleUpperCase("az"));
157+
assertEquals(latin1SupplLowercased, latin1Suppl.toLocaleLowerCase("az"));
158+
assertEquals(latin1SupplUppercased, latin1Suppl.toLocaleUpperCase("lt"));
159+
// Lithuanian need to have a dot-above for U+00CC(Ì) and U+00CD(Í) when
160+
// lowercasing.
161+
assertEquals("\u00A0¡¢£¤¥¦§¨©ª«¬\u00AD®°±²³´µ¶·¸¹º»¼½¾¿" +
162+
"àáâãäåæçèéêëi\u0307\u0300i\u0307\u0301îïðñòóôõö×øùúûüýþß" +
163+
"àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ",
164+
latin1Suppl.toLocaleLowerCase("lt"));

0 commit comments

Comments
 (0)