Lines Matching defs:isolate

14 #include "src/execution/isolate.h"
298 Isolate* isolate, const std::string& unit) {
374 Handle<String> StyleAsString(Isolate* isolate, Style style) {
377 return ReadOnlyRoots(isolate).percent_string_handle();
379 return ReadOnlyRoots(isolate).currency_string_handle();
381 return ReadOnlyRoots(isolate).unit_string_handle();
383 return ReadOnlyRoots(isolate).decimal_string_handle();
389 Handle<String> CurrencyDisplayString(Isolate* isolate,
394 return ReadOnlyRoots(isolate).code_string_handle();
399 return ReadOnlyRoots(isolate).name_string_handle();
404 return ReadOnlyRoots(isolate).narrowSymbol_string_handle();
407 return ReadOnlyRoots(isolate).symbol_string_handle();
415 Handle<Object> UseGroupingFromSkeleton(Isolate* isolate,
417 Factory* factory = isolate->factory();
431 return ReadOnlyRoots(isolate).min2_string_handle();
436 return ReadOnlyRoots(isolate).always_string_handle();
441 return ReadOnlyRoots(isolate).auto_string_handle();
468 Handle<String> CurrencySignString(Isolate* isolate,
474 return ReadOnlyRoots(isolate).accounting_string_handle();
476 return ReadOnlyRoots(isolate).standard_string_handle();
480 Handle<String> UnitDisplayString(Isolate* isolate,
485 return ReadOnlyRoots(isolate).long_string_handle();
490 return ReadOnlyRoots(isolate).narrow_string_handle();
494 return ReadOnlyRoots(isolate).short_string_handle();
520 Handle<String> NotationAsString(Isolate* isolate, Notation notation) {
523 return ReadOnlyRoots(isolate).scientific_string_handle();
525 return ReadOnlyRoots(isolate).engineering_string_handle();
527 return ReadOnlyRoots(isolate).compact_string_handle();
529 return ReadOnlyRoots(isolate).standard_string_handle();
535 Handle<String> CompactDisplayString(Isolate* isolate,
540 return ReadOnlyRoots(isolate).long_string_handle();
545 return ReadOnlyRoots(isolate).short_string_handle();
549 Handle<String> SignDisplayString(Isolate* isolate,
554 return ReadOnlyRoots(isolate).never_string_handle();
561 return ReadOnlyRoots(isolate).always_string_handle();
568 return ReadOnlyRoots(isolate).exceptZero_string_handle();
575 return ReadOnlyRoots(isolate).negative_string_handle();
577 return ReadOnlyRoots(isolate).auto_string_handle();
581 Handle<String> RoundingModeString(Isolate* isolate,
592 return ReadOnlyRoots(isolate).ceil_string_handle();
597 return ReadOnlyRoots(isolate).trunc_string_handle();
602 return ReadOnlyRoots(isolate).floor_string_handle();
607 return ReadOnlyRoots(isolate).halfCeil_string_handle();
612 return ReadOnlyRoots(isolate).halfTrunc_string_handle();
617 return ReadOnlyRoots(isolate).halfFloor_string_handle();
622 return ReadOnlyRoots(isolate).halfExpand_string_handle();
627 return ReadOnlyRoots(isolate).expand_string_handle();
632 return ReadOnlyRoots(isolate).halfEven_string_handle();
635 Handle<Object> RoundingIncrement(Isolate* isolate,
638 if (cur < 0) return isolate->factory()->NewNumberFromInt(1);
647 return isolate->factory()->NewNumberFromInt(increment);
651 Handle<String> RoundingPriorityString(Isolate* isolate,
658 return ReadOnlyRoots(isolate).morePrecision_string_handle();
665 return ReadOnlyRoots(isolate).lessPrecision_string_handle();
668 return ReadOnlyRoots(isolate).auto_string_handle();
672 Handle<String> TrailingZeroDisplayString(Isolate* isolate,
677 return ReadOnlyRoots(isolate).stripIfInteger_string_handle();
680 return ReadOnlyRoots(isolate).auto_string_handle();
916 Isolate* isolate, Handle<JSNumberFormat> number_format) {
917 Factory* factory = isolate->factory();
926 Handle<JSObject> options = factory->NewJSObject(isolate->object_function());
928 Handle<String> locale = Handle<String>(number_format->locale(), isolate);
957 CHECK(JSReceiver::CreateDataProperty(isolate, options,
962 CHECK(Intl::ToString(isolate, numberingSystem_ustr)
964 CHECK(JSReceiver::CreateDataProperty(isolate, options,
970 isolate, options, factory->style_string(),
971 StyleAsString(isolate, style), Just(kDontThrow))
976 CHECK(Intl::ToString(isolate, currency_ustr).ToHandle(&currency_string));
977 CHECK(JSReceiver::CreateDataProperty(isolate, options,
983 isolate, options, factory->currencyDisplay_string(),
984 CurrencyDisplayString(isolate, skeleton), Just(kDontThrow))
987 isolate, options, factory->currencySign_string(),
988 CurrencySignString(isolate, skeleton), Just(kDontThrow))
996 isolate, options, factory->unit_string(),
997 isolate->factory()->NewStringFromAsciiChecked(unit.c_str()),
1002 isolate, options, factory->unitDisplay_string(),
1003 UnitDisplayString(isolate, skeleton), Just(kDontThrow))
1009 isolate, options, factory->minimumIntegerDigits_string(),
1017 isolate, options, factory->minimumSignificantDigits_string(),
1021 isolate, options, factory->maximumSignificantDigits_string(),
1027 isolate, options, factory->minimumFractionDigits_string(),
1031 isolate, options, factory->maximumFractionDigits_string(),
1038 isolate, options, factory->useGrouping_string(),
1039 UseGroupingFromSkeleton(isolate, skeleton), Just(kDontThrow))
1043 isolate, options, factory->useGrouping_string(),
1051 isolate, options, factory->notation_string(),
1052 NotationAsString(isolate, notation), Just(kDontThrow))
1057 isolate, options, factory->compactDisplay_string(),
1058 CompactDisplayString(isolate, skeleton), Just(kDontThrow))
1062 isolate, options, factory->signDisplay_string(),
1063 SignDisplayString(isolate, skeleton), Just(kDontThrow))
1067 isolate, options, factory->roundingMode_string(),
1068 RoundingModeString(isolate, skeleton), Just(kDontThrow))
1071 isolate, options, factory->roundingIncrement_string(),
1072 RoundingIncrement(isolate, skeleton), Just(kDontThrow))
1075 isolate, options, factory->trailingZeroDisplay_string(),
1076 TrailingZeroDisplayString(isolate, skeleton), Just(kDontThrow))
1079 isolate, options, factory->roundingPriority_string(),
1080 RoundingPriorityString(isolate, skeleton), Just(kDontThrow))
1088 Isolate* isolate, Handle<JSReceiver> format_holder) {
1092 Handle<Context>(isolate->context().native_context(), isolate);
1094 JSFunction::cast(native_context->intl_number_format_function()), isolate);
1097 isolate, object,
1098 Intl::LegacyUnwrapReceiver(isolate, format_holder, constructor,
1105 THROW_NEW_ERROR(isolate,
1107 isolate->factory()->NewStringFromAsciiChecked(
1124 MaybeHandle<JSNumberFormat> JSNumberFormat::New(Isolate* isolate,
1129 Factory* factory = isolate->factory();
1133 Intl::CanonicalizeLocaleList(isolate, locales);
1141 isolate, options, CoerceOptionsToObject(isolate, options_obj, service),
1149 Intl::GetLocaleMatcher(isolate, options, service);
1157 isolate, options, service, &numbering_system_str);
1170 Intl::ResolveLocale(isolate, JSNumberFormat::GetAvailableLocales(),
1173 THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),
1192 Handle<String> locale_str = isolate->factory()->NewStringFromAsciiChecked(
1223 isolate, options, "style", service,
1237 isolate, options, "currency", empty_values, service, &currency_cstr);
1249 isolate,
1259 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kCurrencyCode),
1267 isolate, options, "currencyDisplay", service,
1279 isolate, options, "currencySign", service, {"standard", "accounting"},
1288 Maybe<bool> found_unit = GetStringOption(isolate, options, "unit",
1300 IsWellFormedUnitIdentifier(isolate, unit);
1303 isolate,
1314 THROW_NEW_ERROR(isolate,
1325 isolate, options, "unitDisplay", service, {"short", "narrow", "long"},
1336 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kCurrencyCode),
1347 ASSIGN_RETURN_ON_EXCEPTION(isolate, currency_string,
1348 Intl::ToString(isolate, currency_ustr),
1367 isolate->CountUsage(v8::Isolate::UseCounterFeature::kNumberFormatStyleUnit);
1420 isolate, options, "notation", service,
1432 Intl::SetNumberFormatDigitOptions(isolate, options, mnfd_default,
1443 isolate, options, factory->roundingIncrement_string(), 1, 5000, 1);
1450 THROW_NEW_ERROR(isolate,
1459 THROW_NEW_ERROR(isolate,
1470 isolate, options, "trailingZeroDisplay", service,
1491 isolate, options, "compactDisplay", service, {"short", "long"},
1507 GetBoolOption(isolate, options, "useGrouping", service, &use_grouping);
1531 isolate, options, "useGrouping", service,
1550 isolate, options, "signDisplay", service,
1557 isolate, options, "signDisplay", service,
1582 isolate, options, "roundingMode", service,
1622 isolate, 0,
1628 isolate, 0,
1634 isolate->factory()->NewFastOrSlowJSObjectFromMap(map));
1650 Isolate* isolate,
1658 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string,
1659 BigInt::ToString(isolate, big_int),
1661 big_int_string = String::Flatten(isolate, big_int_string);
1674 String::Flatten(isolate, Handle<String>::cast(numeric_obj));
1702 isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>());
1707 Maybe<icu::Formattable> ToFormattable(Isolate* isolate, Handle<Object> obj,
1712 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string,
1713 BigInt::ToString(isolate, big_int),
1715 big_int_string = String::Flatten(isolate, big_int_string);
1727 THROW_NEW_ERROR_RETURN_VALUE(isolate,
1847 Maybe<int> ConstructParts(Isolate* isolate, icu::FormattedValue* formatted,
1854 isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<int>());
1888 Handle<String> field_type_string = isolate->factory()->literal_string();
1893 field_type_string = isolate->factory()->unit_string();
1896 Intl::NumberFieldToType(isolate, part, formatted_text, is_nan);
1901 isolate, substring,
1902 Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos),
1907 isolate, result, index, field_type_string, substring,
1908 isolate->factory()->source_string(),
1909 Intl::SourceString(isolate,
1912 Intl::AddElement(isolate, result, index, field_type_string, substring);
1920 bool IsPositiveInfinity(Isolate* isolate, Handle<Object> v) {
1923 return isolate->factory()->Infinity_string()->Equals(String::cast(*v));
1930 bool IsNegativeInfinity(Isolate* isolate, Handle<Object> v) {
1933 return isolate->factory()->minus_Infinity_string()->Equals(
1941 bool IsNegativeZero(Isolate* isolate, Handle<Object> v) {
1944 return isolate->factory()->minus_0()->Equals(String::cast(*v));
1950 bool LessThan(Isolate* isolate, Handle<Object> a, Handle<Object> b) {
1951 Maybe<ComparisonResult> comparison = Object::Compare(isolate, a, b);
1956 bool IsFiniteNonMinusZeroNumberOrBigInt(Isolate* isolate, Handle<Object> v) {
1957 return !(IsPositiveInfinity(isolate, v) || IsNegativeInfinity(isolate, v) ||
1965 MaybeHandle<T> PartitionNumberRangePattern(Isolate* isolate,
1969 Factory* factory = isolate->factory();
1974 isolate,
1981 isolate,
1988 if (IsFiniteNonMinusZeroNumberOrBigInt(isolate, x)) {
1990 if (IsFiniteNonMinusZeroNumberOrBigInt(isolate, y) &&
1991 LessThan(isolate, y, x)) {
1993 isolate, NewRangeError(MessageTemplate::kInvalid, x, y),
1997 if (IsNegativeInfinity(isolate, y)) {
1999 isolate, NewRangeError(MessageTemplate::kInvalid, x, y),
2004 !LessThan(isolate, x, Handle<Object>(Smi::zero(), isolate))) {
2006 isolate, NewRangeError(MessageTemplate::kInvalid, x, y),
2010 } else if (IsPositiveInfinity(isolate, x)) {
2012 if (IsFiniteNonMinusZeroNumberOrBigInt(isolate, y)) {
2014 isolate, NewRangeError(MessageTemplate::kInvalid, x, y),
2018 if (IsNegativeInfinity(isolate, y)) {
2020 isolate, NewRangeError(MessageTemplate::kInvalid, x, y),
2024 if (IsNegativeZero(isolate, y)) {
2026 isolate, NewRangeError(MessageTemplate::kInvalid, x, y),
2030 } else if (IsNegativeZero(isolate, x)) {
2032 if (IsFiniteNonMinusZeroNumberOrBigInt(isolate, y) &&
2033 LessThan(isolate, y, Handle<Object>(Smi::zero(), isolate))) {
2035 isolate, NewRangeError(MessageTemplate::kInvalid, x, y),
2039 if (IsNegativeInfinity(isolate, y)) {
2041 isolate, NewRangeError(MessageTemplate::kInvalid, x, y),
2046 Maybe<icu::Formattable> maybe_x = ToFormattable(isolate, x, "start");
2049 Maybe<icu::Formattable> maybe_y = ToFormattable(isolate, y, "end");
2060 isolate, NewTypeError(MessageTemplate::kIcuError), MaybeHandle<T>());
2063 return F(isolate, &formatted, number_format->icu_number_formatter().raw(),
2067 MaybeHandle<String> FormatToString(Isolate* isolate,
2074 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String);
2076 return Intl::ToString(isolate, result);
2080 Isolate* isolate, icu::FormattedValue* formatted,
2087 Factory* factory = isolate->factory();
2090 isolate, formatted, result, 0, is_unit, is_nan, output_source);
2096 Isolate* isolate, icu::FormattedValue* formatted,
2098 return FormatToJSArray(isolate, formatted, nfmt, is_nan, true);
2104 Isolate* isolate,
2111 IcuFormatNumber(isolate, number_format, numeric_obj, &formatted);
2114 return FormatToString(isolate, &formatted, &number_format,
2119 Isolate* isolate, Handle<JSNumberFormat> number_format,
2128 IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted);
2131 return FormatToJSArray(isolate, &formatted, fmt, numeric_obj->IsNaN(), false);
2135 Isolate* isolate, Handle<JSNumberFormat> number_format,
2138 isolate, number_format, x_obj, y_obj,
2143 Isolate* isolate, Handle<JSNumberFormat> number_format,
2146 isolate, number_format, x_obj, y_obj,