OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 #ifdef V8_I18N_SUPPORT | 6 #ifdef V8_I18N_SUPPORT |
7 #include "src/runtime/runtime-utils.h" | 7 #include "src/runtime/runtime-utils.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 return *isolate->factory()->NewStringFromStaticChars("ideo"); | 794 return *isolate->factory()->NewStringFromStaticChars("ideo"); |
795 } else { | 795 } else { |
796 return *isolate->factory()->NewStringFromStaticChars("unknown"); | 796 return *isolate->factory()->NewStringFromStaticChars("unknown"); |
797 } | 797 } |
798 } | 798 } |
799 | 799 |
800 namespace { | 800 namespace { |
801 void ConvertCaseWithTransliterator(icu::UnicodeString* input, | 801 void ConvertCaseWithTransliterator(icu::UnicodeString* input, |
802 const char* transliterator_id) { | 802 const char* transliterator_id) { |
803 UErrorCode status = U_ZERO_ERROR; | 803 UErrorCode status = U_ZERO_ERROR; |
804 base::SmartPointer<icu::Transliterator> translit( | 804 std::unique_ptr<icu::Transliterator> translit( |
805 icu::Transliterator::createInstance( | 805 icu::Transliterator::createInstance( |
806 icu::UnicodeString(transliterator_id, -1, US_INV), UTRANS_FORWARD, | 806 icu::UnicodeString(transliterator_id, -1, US_INV), UTRANS_FORWARD, |
807 status)); | 807 status)); |
808 if (U_FAILURE(status)) return; | 808 if (U_FAILURE(status)) return; |
809 translit->transliterate(*input); | 809 translit->transliterate(*input); |
810 } | 810 } |
811 | 811 |
812 MUST_USE_RESULT Object* LocaleConvertCase(Handle<String> s, Isolate* isolate, | 812 MUST_USE_RESULT Object* LocaleConvertCase(Handle<String> s, Isolate* isolate, |
813 bool is_to_upper, const char* lang) { | 813 bool is_to_upper, const char* lang) { |
814 int32_t src_length = s->length(); | 814 int32_t src_length = s->length(); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 Handle<FixedArray> date_cache_version = | 1147 Handle<FixedArray> date_cache_version = |
1148 Handle<FixedArray>::cast(isolate->eternal_handles()->GetSingleton( | 1148 Handle<FixedArray>::cast(isolate->eternal_handles()->GetSingleton( |
1149 EternalHandles::DATE_CACHE_VERSION)); | 1149 EternalHandles::DATE_CACHE_VERSION)); |
1150 return date_cache_version->get(0); | 1150 return date_cache_version->get(0); |
1151 } | 1151 } |
1152 | 1152 |
1153 } // namespace internal | 1153 } // namespace internal |
1154 } // namespace v8 | 1154 } // namespace v8 |
1155 | 1155 |
1156 #endif // V8_I18N_SUPPORT | 1156 #endif // V8_I18N_SUPPORT |
OLD | NEW |