[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: Yang Guo <yangguo@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/master@{#64028}
This commit is contained in:
parent
7dedd92998
commit
a0133350bf
@ -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);
|
||||
|
14
test/intl/regress-9356.js
Normal file
14
test/intl/regress-9356.js
Normal file
@ -0,0 +1,14 @@
|
||||
// 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]));
|
Loading…
Reference in New Issue
Block a user