[Intl] add 'b' and 'B' to the skip list.

Mentioned by ICU guru during design review. Bug in theory, but
cannot find a locale has 'b' and 'B' in the 12 date/time style
canned pattern.

Bug: v8:8877
Change-Id: I126fdf979e8ea5b97773c8fd974359a7e52f18e9
Reviewed-on: https://chromium-review.googlesource.com/c/1480922
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59928}
This commit is contained in:
Frank Tang 2019-02-21 17:47:06 -08:00 committed by Commit Bot
parent 985301d8a4
commit e6debb13bb

View File

@ -1008,12 +1008,21 @@ icu::UnicodeString ReplaceSkeleton(const icu::UnicodeString input,
}
for (int32_t i = 0; i < input.length(); i++) {
switch (input[i]) {
// We need to skip 'a', 'b', 'B' here due to
// https://unicode-org.atlassian.net/browse/ICU-20437
case 'a':
V8_FALLTHROUGH;
case 'b':
V8_FALLTHROUGH;
case 'B':
// ignore
break;
case 'h':
V8_FALLTHROUGH;
case 'H':
V8_FALLTHROUGH;
case 'K':
V8_FALLTHROUGH;
case 'k':
result += to;
break;