OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 // limitations under the License. | 4 // limitations under the License. |
5 | 5 |
6 #include "src/i18n.h" | 6 #include "src/i18n.h" |
7 | 7 |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 void SetResolvedDateSettings(Isolate* isolate, | 139 void SetResolvedDateSettings(Isolate* isolate, |
140 const icu::Locale& icu_locale, | 140 const icu::Locale& icu_locale, |
141 icu::SimpleDateFormat* date_format, | 141 icu::SimpleDateFormat* date_format, |
142 Handle<JSObject> resolved) { | 142 Handle<JSObject> resolved) { |
143 Factory* factory = isolate->factory(); | 143 Factory* factory = isolate->factory(); |
144 UErrorCode status = U_ZERO_ERROR; | 144 UErrorCode status = U_ZERO_ERROR; |
145 icu::UnicodeString pattern; | 145 icu::UnicodeString pattern; |
146 date_format->toPattern(pattern); | 146 date_format->toPattern(pattern); |
147 JSObject::SetProperty( | 147 JSObject::SetProperty( |
148 resolved, factory->NewStringFromStaticChars("pattern"), | 148 resolved, factory->intl_pattern_symbol(), |
149 factory->NewStringFromTwoByte( | 149 factory->NewStringFromTwoByte( |
150 Vector<const uint16_t>( | 150 Vector<const uint16_t>( |
151 reinterpret_cast<const uint16_t*>(pattern.getBuffer()), | 151 reinterpret_cast<const uint16_t*>(pattern.getBuffer()), |
152 pattern.length())).ToHandleChecked(), | 152 pattern.length())).ToHandleChecked(), |
153 SLOPPY).Assert(); | 153 SLOPPY).Assert(); |
154 | 154 |
155 // Set time zone and calendar. | 155 // Set time zone and calendar. |
156 const icu::Calendar* calendar = date_format->getCalendar(); | 156 const icu::Calendar* calendar = date_format->getCalendar(); |
157 const char* calendar_name = calendar->getType(); | 157 const char* calendar_name = calendar->getType(); |
158 JSObject::SetProperty(resolved, factory->NewStringFromStaticChars("calendar"), | 158 JSObject::SetProperty(resolved, factory->NewStringFromStaticChars("calendar"), |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 360 |
361 | 361 |
362 void SetResolvedNumberSettings(Isolate* isolate, | 362 void SetResolvedNumberSettings(Isolate* isolate, |
363 const icu::Locale& icu_locale, | 363 const icu::Locale& icu_locale, |
364 icu::DecimalFormat* number_format, | 364 icu::DecimalFormat* number_format, |
365 Handle<JSObject> resolved) { | 365 Handle<JSObject> resolved) { |
366 Factory* factory = isolate->factory(); | 366 Factory* factory = isolate->factory(); |
367 icu::UnicodeString pattern; | 367 icu::UnicodeString pattern; |
368 number_format->toPattern(pattern); | 368 number_format->toPattern(pattern); |
369 JSObject::SetProperty( | 369 JSObject::SetProperty( |
370 resolved, factory->NewStringFromStaticChars("pattern"), | 370 resolved, factory->intl_pattern_symbol(), |
371 factory->NewStringFromTwoByte( | 371 factory->NewStringFromTwoByte( |
372 Vector<const uint16_t>( | 372 Vector<const uint16_t>( |
373 reinterpret_cast<const uint16_t*>(pattern.getBuffer()), | 373 reinterpret_cast<const uint16_t*>(pattern.getBuffer()), |
374 pattern.length())).ToHandleChecked(), | 374 pattern.length())).ToHandleChecked(), |
375 SLOPPY).Assert(); | 375 SLOPPY).Assert(); |
376 | 376 |
377 // Set resolved currency code in options.currency if not empty. | 377 // Set resolved currency code in options.currency if not empty. |
378 icu::UnicodeString currency(number_format->getCurrency()); | 378 icu::UnicodeString currency(number_format->getCurrency()); |
379 if (!currency.isEmpty()) { | 379 if (!currency.isEmpty()) { |
380 JSObject::SetProperty( | 380 JSObject::SetProperty( |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 | 973 |
974 void BreakIterator::DeleteBreakIterator( | 974 void BreakIterator::DeleteBreakIterator( |
975 const v8::WeakCallbackData<v8::Value, void>& data) { | 975 const v8::WeakCallbackData<v8::Value, void>& data) { |
976 DeleteNativeObjectAt<icu::BreakIterator>(data, 0); | 976 DeleteNativeObjectAt<icu::BreakIterator>(data, 0); |
977 DeleteNativeObjectAt<icu::UnicodeString>(data, 1); | 977 DeleteNativeObjectAt<icu::UnicodeString>(data, 1); |
978 DestroyGlobalHandle(data); | 978 DestroyGlobalHandle(data); |
979 } | 979 } |
980 | 980 |
981 } // namespace internal | 981 } // namespace internal |
982 } // namespace v8 | 982 } // namespace v8 |
OLD | NEW |