1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:47:35 +00:00

LibJS: Replace usages of JS_{DECLARE, DEFINE}_NATIVE_GETTER

These macros are equivalent to JS_{DECLARE, DEFINE}_NATIVE_FUNCTION and
were only sometimes used, so let's just get rid of them altogether.
This commit is contained in:
Idan Horowitz 2021-10-19 20:14:01 +03:00 committed by Linus Groh
parent ae9b52e387
commit 56e769e4ba
34 changed files with 72 additions and 72 deletions

View file

@ -92,7 +92,7 @@ JS_DEFINE_NATIVE_FUNCTION(LocalePrototype::to_string)
}
// 14.3.6 get Intl.Locale.prototype.baseName, https://tc39.es/ecma402/#sec-Intl.Locale.prototype.baseName
JS_DEFINE_NATIVE_GETTER(LocalePrototype::base_name)
JS_DEFINE_NATIVE_FUNCTION(LocalePrototype::base_name)
{
// 1. Let loc be the this value.
// 2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
@ -119,7 +119,7 @@ JS_DEFINE_NATIVE_GETTER(LocalePrototype::base_name)
// 14.3.10 get Intl.Locale.prototype.hourCycle, https://tc39.es/ecma402/#sec-Intl.Locale.prototype.hourCycle
// 14.3.12 get Intl.Locale.prototype.numberingSystem, https://tc39.es/ecma402/#sec-Intl.Locale.prototype.numberingSystem
#define __JS_ENUMERATE(keyword) \
JS_DEFINE_NATIVE_GETTER(LocalePrototype::keyword) \
JS_DEFINE_NATIVE_FUNCTION(LocalePrototype::keyword) \
{ \
auto* locale_object = TRY_OR_DISCARD(typed_this_object(global_object)); \
if (!locale_object->has_##keyword()) \
@ -130,7 +130,7 @@ JS_ENUMERATE_LOCALE_KEYWORD_PROPERTIES
#undef __JS_ENUMERATE
// 14.3.11 get Intl.Locale.prototype.numeric, https://tc39.es/ecma402/#sec-Intl.Locale.prototype.numeric
JS_DEFINE_NATIVE_GETTER(LocalePrototype::numeric)
JS_DEFINE_NATIVE_FUNCTION(LocalePrototype::numeric)
{
// 1. Let loc be the this value.
// 2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
@ -141,7 +141,7 @@ JS_DEFINE_NATIVE_GETTER(LocalePrototype::numeric)
}
// 14.3.13 get Intl.Locale.prototype.language, https://tc39.es/ecma402/#sec-Intl.Locale.prototype.language
JS_DEFINE_NATIVE_GETTER(LocalePrototype::language)
JS_DEFINE_NATIVE_FUNCTION(LocalePrototype::language)
{
// 1. Let loc be the this value.
// 2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
@ -158,7 +158,7 @@ JS_DEFINE_NATIVE_GETTER(LocalePrototype::language)
}
// 14.3.14 get Intl.Locale.prototype.script, https://tc39.es/ecma402/#sec-Intl.Locale.prototype.script
JS_DEFINE_NATIVE_GETTER(LocalePrototype::script)
JS_DEFINE_NATIVE_FUNCTION(LocalePrototype::script)
{
// 1. Let loc be the this value.
// 2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
@ -179,7 +179,7 @@ JS_DEFINE_NATIVE_GETTER(LocalePrototype::script)
}
// 14.3.15 get Intl.Locale.prototype.region, https://tc39.es/ecma402/#sec-Intl.Locale.prototype.region
JS_DEFINE_NATIVE_GETTER(LocalePrototype::region)
JS_DEFINE_NATIVE_FUNCTION(LocalePrototype::region)
{
// 1. Let loc be the this value.
// 2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).

View file

@ -24,16 +24,16 @@ private:
JS_DECLARE_NATIVE_FUNCTION(minimize);
JS_DECLARE_NATIVE_FUNCTION(to_string);
JS_DECLARE_NATIVE_GETTER(base_name);
JS_DECLARE_NATIVE_GETTER(calendar);
JS_DECLARE_NATIVE_GETTER(case_first);
JS_DECLARE_NATIVE_GETTER(collation);
JS_DECLARE_NATIVE_GETTER(hour_cycle);
JS_DECLARE_NATIVE_GETTER(numbering_system);
JS_DECLARE_NATIVE_GETTER(numeric);
JS_DECLARE_NATIVE_GETTER(language);
JS_DECLARE_NATIVE_GETTER(script);
JS_DECLARE_NATIVE_GETTER(region);
JS_DECLARE_NATIVE_FUNCTION(base_name);
JS_DECLARE_NATIVE_FUNCTION(calendar);
JS_DECLARE_NATIVE_FUNCTION(case_first);
JS_DECLARE_NATIVE_FUNCTION(collation);
JS_DECLARE_NATIVE_FUNCTION(hour_cycle);
JS_DECLARE_NATIVE_FUNCTION(numbering_system);
JS_DECLARE_NATIVE_FUNCTION(numeric);
JS_DECLARE_NATIVE_FUNCTION(language);
JS_DECLARE_NATIVE_FUNCTION(script);
JS_DECLARE_NATIVE_FUNCTION(region);
};
}