Commit a0133350 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[Intl] Fix /ſ/i.test('ſ'.toUpperCase()) be false.

Address special case condiction for U+017F.

Bug: v8:9356
Change-Id: Id24e5e2c999b198bf0f696aea8c98f223508c051
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1827683
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64028}
parent 7dedd929
......@@ -725,6 +725,11 @@ static int GetCaseIndependentLetters(Isolate* isolate, uc16 character,
unibrow::uchar* letters,
int letter_length) {
#ifdef V8_INTL_SUPPORT
// Special case for U+017F which has upper case in ASCII range.
if (character == 0x017f) {
letters[0] = character;
return 1;
}
icu::UnicodeSet set;
set.add(character);
set = set.closeOver(USET_CASE_INSENSITIVE);
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
assertFalse(/ſ/i.test('ſ'.toUpperCase()));
assertFalse(/ſ/i.test('ſ'.toUpperCase()[0]));
assertTrue(/ſ/i.test('ſ'));
assertTrue(/ſ/i.test('ſ'[0]));
assertFalse(/ſ/i.test('s'.toUpperCase()));
assertFalse(/ſ/i.test('s'.toUpperCase()[0]));
assertFalse(/ſ/i.test('S'.toUpperCase()));
assertFalse(/ſ/i.test('S'.toUpperCase()[0]));
assertFalse(/ſ/i.test('S'));
assertFalse(/ſ/i.test('S'[0]));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment