1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:17:44 +00:00

LibJS: Rename define_native_function => define_old_native_function

This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
This commit is contained in:
Idan Horowitz 2021-10-20 01:40:40 +03:00 committed by Linus Groh
parent ca27e5eff5
commit 40eb3a39d4
95 changed files with 755 additions and 755 deletions

View file

@ -31,7 +31,7 @@ void DisplayNamesConstructor::initialize(GlobalObject& global_object)
define_direct_property(vm.names.prototype, global_object.intl_display_names_prototype(), 0);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
define_old_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
define_direct_property(vm.names.length, Value(2), Attribute::Configurable);
}

View file

@ -28,8 +28,8 @@ void DisplayNamesPrototype::initialize(GlobalObject& global_object)
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.DisplayNames"), Attribute::Configurable);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.of, of, 1, attr);
define_native_function(vm.names.resolvedOptions, resolved_options, 0, attr);
define_old_native_function(vm.names.of, of, 1, attr);
define_old_native_function(vm.names.resolvedOptions, resolved_options, 0, attr);
}
// 12.4.3 Intl.DisplayNames.prototype.of ( code ), https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.of

View file

@ -36,7 +36,7 @@ void Intl::initialize(GlobalObject& global_object)
define_direct_property(vm.names.Locale, global_object.intl_locale_constructor(), attr);
define_direct_property(vm.names.NumberFormat, global_object.intl_number_format_constructor(), attr);
define_native_function(vm.names.getCanonicalLocales, get_canonical_locales, 1, attr);
define_old_native_function(vm.names.getCanonicalLocales, get_canonical_locales, 1, attr);
}
// 8.3.1 Intl.getCanonicalLocales ( locales ), https://tc39.es/ecma402/#sec-intl.getcanonicallocales

View file

@ -30,7 +30,7 @@ void ListFormatConstructor::initialize(GlobalObject& global_object)
define_direct_property(vm.names.prototype, global_object.intl_list_format_prototype(), 0);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
define_old_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
}

View file

@ -28,9 +28,9 @@ void ListFormatPrototype::initialize(GlobalObject& global_object)
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.ListFormat"), Attribute::Configurable);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.format, format, 1, attr);
define_native_function(vm.names.formatToParts, format_to_parts, 1, attr);
define_native_function(vm.names.resolvedOptions, resolved_options, 0, attr);
define_old_native_function(vm.names.format, format, 1, attr);
define_old_native_function(vm.names.formatToParts, format_to_parts, 1, attr);
define_old_native_function(vm.names.resolvedOptions, resolved_options, 0, attr);
}
// 13.4.3 Intl.ListFormat.prototype.format ( list ), https://tc39.es/ecma402/#sec-Intl.ListFormat.prototype.format

View file

@ -25,23 +25,23 @@ void LocalePrototype::initialize(GlobalObject& global_object)
auto& vm = this->vm();
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.maximize, maximize, 0, attr);
define_native_function(vm.names.minimize, minimize, 0, attr);
define_native_function(vm.names.toString, to_string, 0, attr);
define_old_native_function(vm.names.maximize, maximize, 0, attr);
define_old_native_function(vm.names.minimize, minimize, 0, attr);
define_old_native_function(vm.names.toString, to_string, 0, attr);
// 14.3.2 Intl.Locale.prototype[ @@toStringTag ], https://tc39.es/ecma402/#sec-Intl.Locale.prototype-@@tostringtag
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.Locale"), Attribute::Configurable);
define_native_accessor(vm.names.baseName, base_name, {}, Attribute::Configurable);
define_native_accessor(vm.names.calendar, calendar, {}, Attribute::Configurable);
define_native_accessor(vm.names.caseFirst, case_first, {}, Attribute::Configurable);
define_native_accessor(vm.names.collation, collation, {}, Attribute::Configurable);
define_native_accessor(vm.names.hourCycle, hour_cycle, {}, Attribute::Configurable);
define_native_accessor(vm.names.numberingSystem, numbering_system, {}, Attribute::Configurable);
define_native_accessor(vm.names.numeric, numeric, {}, Attribute::Configurable);
define_native_accessor(vm.names.language, language, {}, Attribute::Configurable);
define_native_accessor(vm.names.script, script, {}, Attribute::Configurable);
define_native_accessor(vm.names.region, region, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.baseName, base_name, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.calendar, calendar, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.caseFirst, case_first, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.collation, collation, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.hourCycle, hour_cycle, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.numberingSystem, numbering_system, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.numeric, numeric, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.language, language, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.script, script, {}, Attribute::Configurable);
define_old_native_accessor(vm.names.region, region, {}, Attribute::Configurable);
}
// 14.3.3 Intl.Locale.prototype.maximize ( ), https://tc39.es/ecma402/#sec-Intl.Locale.prototype.maximize

View file

@ -29,7 +29,7 @@ void NumberFormatConstructor::initialize(GlobalObject& global_object)
define_direct_property(vm.names.prototype, global_object.intl_number_format_prototype(), 0);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
define_old_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr);
define_direct_property(vm.names.length, Value(0), Attribute::Configurable);
}

View file

@ -27,7 +27,7 @@ void NumberFormatPrototype::initialize(GlobalObject& global_object)
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.NumberFormat"), Attribute::Configurable);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.resolvedOptions, resolved_options, 0, attr);
define_old_native_function(vm.names.resolvedOptions, resolved_options, 0, attr);
}
// 15.4.5 Intl.NumberFormat.prototype.resolvedOptions ( ), https://tc39.es/ecma402/#sec-intl.numberformat.prototype.resolvedoptions