Lines Matching defs:isolate

19 #include "src/execution/isolate.h"
78 Maybe<JSDateTimeFormat::HourCycle> GetHourCycle(Isolate* isolate,
82 isolate, options, "hourCycle", method_name, {"h11", "h12", "h23", "h24"},
469 Handle<String> DateTimeStyleAsString(Isolate* isolate,
473 return ReadOnlyRoots(isolate).full_string_handle();
475 return ReadOnlyRoots(isolate).long_string_handle();
477 return ReadOnlyRoots(isolate).medium_string_handle();
479 return ReadOnlyRoots(isolate).short_string_handle();
497 Handle<Object> JSDateTimeFormat::TimeZoneId(Isolate* isolate,
499 Factory* factory = isolate->factory();
518 isolate, timezone_value, Intl::ToString(isolate, canonical_time_zone),
529 Handle<String> GetCalendar(Isolate* isolate,
554 return isolate->factory()->NewStringFromAsciiChecked(calendar_str.c_str());
557 Handle<Object> GetTimeZone(Isolate* isolate,
560 isolate, simple_date_format.getCalendar()->getTimeZone());
565 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format) {
566 return GetCalendar(isolate,
572 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format) {
573 return GetTimeZone(isolate,
579 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format) {
580 Factory* factory = isolate->factory();
582 Handle<JSObject> options = factory->NewJSObject(isolate->object_function());
586 Handle<String> locale = Handle<String>(date_time_format->locale(), isolate);
594 JSDateTimeFormat::TimeZone(isolate, date_time_format);
627 isolate, options, factory->locale_string(), locale, Just(kDontThrow));
632 JSDateTimeFormat::Calendar(isolate, date_time_format);
634 isolate, options, factory->calendar_string(), calendar, Just(kDontThrow));
640 isolate, options, factory->numberingSystem_string(),
647 isolate, options, factory->timeZone_string(), timezone, Just(kDontThrow));
656 isolate, options, factory->hourCycle_string(),
665 isolate, options, factory->hour12_string(), factory->true_value(),
674 isolate, options, factory->hour12_string(), factory->false_value(),
697 isolate, options, factory->fractionalSecondDigits_string(),
706 isolate, options,
721 isolate, options, factory->dateStyle_string(),
722 DateTimeStyleAsString(isolate, date_time_format->date_style()),
731 isolate, options, factory->timeStyle_string(),
732 DateTimeStyleAsString(isolate, date_time_format->time_style()),
744 MaybeHandle<String> FormatDateTime(Isolate* isolate,
749 THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kInvalidTimeValue),
761 return Intl::ToString(isolate, result);
769 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format,
778 x = JSDate::CurrentTimeValue(isolate);
782 ASSIGN_RETURN_ON_EXCEPTION(isolate, date, Object::ToNumber(isolate, date),
790 return FormatDateTime(isolate, *format, x);
808 Isolate* isolate, Handle<Object> date, Handle<Object> locales,
813 Factory* factory = isolate->factory();
816 THROW_NEW_ERROR(isolate,
831 bool can_cache = (locales->IsString() || locales->IsUndefined(isolate)) &&
832 options->IsUndefined(isolate);
837 isolate->get_cached_icu_object(cache_type, locales));
839 return FormatDateTime(isolate, *cached_icu_simple_date_format, x);
845 isolate, internal_options,
846 ToDateTimeOptions(isolate, options, required, defaults), String);
851 isolate->context().native_context().intl_date_time_format_function()),
852 isolate);
855 isolate, map,
856 JSFunction::GetDerivedMap(isolate, constructor, constructor), String);
859 isolate, date_time_format,
860 JSDateTimeFormat::New(isolate, map, locales, internal_options,
865 isolate->set_icu_object_in_cache(
873 return FormatDateTime(isolate, *format, x);
878 Maybe<bool> IsPropertyUndefined(Isolate* isolate, Handle<JSObject> options,
884 isolate, value, Object::GetPropertyOrElement(isolate, options, property),
886 return Just(value->IsUndefined(isolate));
889 Maybe<bool> NeedsDefault(Isolate* isolate, Handle<JSObject> options,
895 Maybe<bool> maybe_undefined = IsPropertyUndefined(isolate, options, prop);
905 Maybe<bool> CreateDefault(Isolate* isolate, Handle<JSObject> options,
907 Factory* factory = isolate->factory();
912 isolate, options, factory->NewStringFromAsciiChecked(prop.c_str()),
923 Isolate* isolate, Handle<Object> input_options, RequiredOption required,
925 Factory* factory = isolate->factory();
929 if (input_options->IsUndefined(isolate)) {
933 ASSIGN_RETURN_ON_EXCEPTION(isolate, options_obj,
934 Object::ToObject(isolate, input_options),
937 ASSIGN_RETURN_ON_EXCEPTION(isolate, options,
938 JSObject::ObjectCreate(isolate, options_obj),
953 Maybe<bool> maybe_needs_default = NeedsDefault(isolate, options, list);
968 Maybe<bool> maybe_needs_default = NeedsDefault(isolate, options, list);
975 IsPropertyUndefined(isolate, options, factory->dateStyle_string());
979 IsPropertyUndefined(isolate, options, factory->timeStyle_string());
992 isolate,
1003 isolate,
1015 MAYBE_RETURN(CreateDefault(isolate, options, list), Handle<JSObject>());
1021 MAYBE_RETURN(CreateDefault(isolate, options, list), Handle<JSObject>());
1029 Isolate* isolate, Handle<JSReceiver> format_holder) {
1031 Handle<Context>(isolate->context().native_context(), isolate);
1034 isolate);
1037 isolate, dtf,
1038 Intl::LegacyUnwrapReceiver(isolate, format_holder, constructor,
1045 THROW_NEW_ERROR(isolate,
1047 isolate->factory()->NewStringFromAsciiChecked(
1122 icu::Calendar* CreateCalendar(Isolate* isolate, const icu::Locale& icu_locale,
1265 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format) {
1292 isolate, 0, std::move(date_interval_format));
1466 icu::DateTimePatternGenerator* CreateGenerator(Isolate* isolate,
1489 isolate, "DateTimePatternGeneratorCache::CreateGenerator");
1495 isolate, "DateTimePatternGeneratorCache::CreateGenerator");
1511 Isolate* isolate, Handle<Map> map, Handle<Object> locales,
1513 Factory* factory = isolate->factory();
1516 Intl::CanonicalizeLocaleList(isolate, locales);
1523 isolate, options,
1525 isolate, input_options, RequiredOption::kAny, DefaultsOption::kDate),
1532 Intl::GetLocaleMatcher(isolate, options, service);
1542 isolate, options, "calendar", empty_values, service, &calendar_str);
1548 isolate,
1558 isolate, options, service, &numbering_system_str);
1565 GetBoolOption(isolate, options, "hour12", service, &hour12);
1570 Maybe<HourCycle> maybe_hour_cycle = GetHourCycle(isolate, options, service);
1592 isolate, JSDateTimeFormat::GetAvailableLocales(), requested_locales,
1595 THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),
1644 generator_cache.Pointer()->CreateGenerator(isolate, icu_locale));
1696 isolate, options, "timeZone", empty_values, service, &timezone);
1703 isolate,
1710 CreateCalendar(isolate, icu_locale, tz.release()));
1716 isolate,
1735 isolate, options, factory->fractionalSecondDigits_string(), 1, 3, 0);
1748 GetStringOption(isolate, options, item.property.c_str(),
1769 isolate, options, "formatMatcher", service, {"best fit", "basic"},
1779 isolate, options, "dateStyle", service,
1791 isolate, options, "timeStyle", service,
1834 isolate,
1846 isolate->CountUsage(
1853 THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),
1875 THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),
1915 Handle<String> locale_str = isolate->factory()->NewStringFromAsciiChecked(
1919 Managed<icu::Locale>::FromRawPtr(isolate, 0, icu_locale.clone());
1922 Managed<icu::SimpleDateFormat>::FromUniquePtr(isolate, 0,
1926 Managed<icu::DateIntervalFormat>::FromRawPtr(isolate, 0, nullptr);
1930 isolate->factory()->NewFastOrSlowJSObjectFromMap(map));
1953 Handle<String> IcuDateFieldIdToDateType(int32_t field_id, Isolate* isolate) {
1956 return isolate->factory()->literal_string();
1959 return isolate->factory()->year_string();
1961 return isolate->factory()->yearName_string();
1964 return isolate->factory()->month_string();
1966 return isolate->factory()->day_string();
1971 return isolate->factory()->hour_string();
1973 return isolate->factory()->minute_string();
1975 return isolate->factory()->second_string();
1979 return isolate->factory()->weekday_string();
1983 return isolate->factory()->dayPeriod_string();
1991 return isolate->factory()->timeZoneName_string();
1993 return isolate->factory()->era_string();
1995 return isolate->factory()->fractionalSecond_string();
1997 return isolate->factory()->relatedYear_string();
2011 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format,
2013 Factory* factory = isolate->factory();
2024 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), JSArray);
2040 isolate, substring,
2041 Intl::ToString(isolate, formatted, previous_end_pos, begin_pos),
2044 Intl::AddElement(isolate, result, index,
2045 IcuDateFieldIdToDateType(-1, isolate), substring,
2046 isolate->factory()->source_string(),
2047 isolate->factory()->shared_string());
2049 Intl::AddElement(isolate, result, index,
2050 IcuDateFieldIdToDateType(-1, isolate), substring);
2055 isolate, substring,
2056 Intl::ToString(isolate, formatted, begin_pos, end_pos), JSArray);
2058 Intl::AddElement(isolate, result, index,
2059 IcuDateFieldIdToDateType(fp.getField(), isolate),
2060 substring, isolate->factory()->source_string(),
2061 isolate->factory()->shared_string());
2063 Intl::AddElement(isolate, result, index,
2064 IcuDateFieldIdToDateType(fp.getField(), isolate),
2072 isolate, substring,
2073 Intl::ToString(isolate, formatted, previous_end_pos, length), JSArray);
2075 Intl::AddElement(isolate, result, index,
2076 IcuDateFieldIdToDateType(-1, isolate), substring,
2077 isolate->factory()->source_string(),
2078 isolate->factory()->shared_string());
2080 Intl::AddElement(isolate, result, index,
2081 IcuDateFieldIdToDateType(-1, isolate), substring);
2112 Isolate* isolate, Handle<JSArray> array, const icu::UnicodeString& string,
2116 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, substring,
2117 Intl::ToString(isolate, string, start, end),
2119 Intl::AddElement(isolate, array, index,
2120 IcuDateFieldIdToDateType(field, isolate), substring,
2121 isolate->factory()->source_string(),
2122 Intl::SourceString(isolate, tracker.GetSource(start, end)));
2126 MaybeHandle<String> FormattedToString(Isolate* isolate,
2132 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String);
2142 return Intl::ToString(isolate, result);
2148 Isolate* isolate, const icu::FormattedValue& formatted, bool* outputRange) {
2152 Factory* factory = isolate->factory();
2175 AddPartForFormatRange(isolate, array, result, index, -1,
2182 isolate, array, result, index, field, start, limit, tracker);
2192 isolate, array, result, index, -1, previous_end_pos, end, tracker);
2197 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), JSArray);
2207 MaybeHandle<T> FormatRangeCommon(Isolate* isolate,
2211 isolate->CountUsage(v8::Isolate::UseCounterFeature::kDateTimeFormatRange);
2218 THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kInvalidTimeValue),
2225 THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kInvalidTimeValue),
2230 LazyCreateDateIntervalFormat(isolate, date_time_format);
2232 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), T);
2250 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), T);
2252 return F(isolate, formatted, outputRange);
2258 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format, double x,
2262 isolate, date_time_format, x, y, &outputRange);
2266 return FormatDateTime(isolate,
2271 Isolate* isolate, Handle<JSDateTimeFormat> date_time_format, double x,
2276 isolate, date_time_format, x, y, &outputRange);
2280 return JSDateTimeFormat::FormatToParts(isolate, date_time_format, x, true);