mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +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:
parent
ae9b52e387
commit
56e769e4ba
34 changed files with 72 additions and 72 deletions
|
@ -78,7 +78,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayBufferConstructor::is_view)
|
|||
}
|
||||
|
||||
// 25.1.4.3 get ArrayBuffer [ @@species ], https://tc39.es/ecma262/#sec-get-arraybuffer-@@species
|
||||
JS_DEFINE_NATIVE_GETTER(ArrayBufferConstructor::symbol_species_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(ArrayBufferConstructor::symbol_species_getter)
|
||||
{
|
||||
return vm.this_value(global_object);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ private:
|
|||
|
||||
JS_DECLARE_NATIVE_FUNCTION(is_view);
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayBufferPrototype::slice)
|
|||
}
|
||||
|
||||
// 25.1.5.1 get ArrayBuffer.prototype.byteLength, https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.bytelength
|
||||
JS_DEFINE_NATIVE_GETTER(ArrayBufferPrototype::byte_length_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(ArrayBufferPrototype::byte_length_getter)
|
||||
{
|
||||
auto* array_buffer_object = TRY_OR_DISCARD(typed_this_value(global_object));
|
||||
// FIXME: Check for shared buffer
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
|
||||
private:
|
||||
JS_DECLARE_NATIVE_FUNCTION(slice);
|
||||
JS_DECLARE_NATIVE_GETTER(byte_length_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(byte_length_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::of)
|
|||
}
|
||||
|
||||
// 23.1.2.5 get Array [ @@species ], https://tc39.es/ecma262/#sec-get-array-@@species
|
||||
JS_DEFINE_NATIVE_GETTER(ArrayConstructor::symbol_species_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::symbol_species_getter)
|
||||
{
|
||||
return vm.this_value(global_object);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ private:
|
|||
JS_DECLARE_NATIVE_FUNCTION(is_array);
|
||||
JS_DECLARE_NATIVE_FUNCTION(of);
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -241,14 +241,14 @@ JS_DEFINE_NATIVE_FUNCTION(DataViewPrototype::set_uint_32)
|
|||
}
|
||||
|
||||
// 25.3.4.1 get DataView.prototype.buffer, https://tc39.es/ecma262/#sec-get-dataview.prototype.buffer
|
||||
JS_DEFINE_NATIVE_GETTER(DataViewPrototype::buffer_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(DataViewPrototype::buffer_getter)
|
||||
{
|
||||
auto* data_view = TRY_OR_DISCARD(typed_this_value(global_object));
|
||||
return data_view->viewed_array_buffer();
|
||||
}
|
||||
|
||||
// 25.3.4.2 get DataView.prototype.byteLength, https://tc39.es/ecma262/#sec-get-dataview.prototype.bytelength
|
||||
JS_DEFINE_NATIVE_GETTER(DataViewPrototype::byte_length_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(DataViewPrototype::byte_length_getter)
|
||||
{
|
||||
auto* data_view = TRY_OR_DISCARD(typed_this_value(global_object));
|
||||
if (data_view->viewed_array_buffer()->is_detached()) {
|
||||
|
@ -259,7 +259,7 @@ JS_DEFINE_NATIVE_GETTER(DataViewPrototype::byte_length_getter)
|
|||
}
|
||||
|
||||
// 25.3.4.3 get DataView.prototype.byteOffset, https://tc39.es/ecma262/#sec-get-dataview.prototype.byteoffset
|
||||
JS_DEFINE_NATIVE_GETTER(DataViewPrototype::byte_offset_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(DataViewPrototype::byte_offset_getter)
|
||||
{
|
||||
auto* data_view = TRY_OR_DISCARD(typed_this_value(global_object));
|
||||
if (data_view->viewed_array_buffer()->is_detached()) {
|
||||
|
|
|
@ -41,9 +41,9 @@ private:
|
|||
JS_DECLARE_NATIVE_FUNCTION(set_uint_16);
|
||||
JS_DECLARE_NATIVE_FUNCTION(set_uint_32);
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(buffer_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(byte_length_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(byte_offset_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(buffer_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(byte_length_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(byte_offset_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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]]).
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ Value MapConstructor::construct(FunctionObject& new_target)
|
|||
}
|
||||
|
||||
// 24.1.2.2 get Map [ @@species ], https://tc39.es/ecma262/#sec-get-map-@@species
|
||||
JS_DEFINE_NATIVE_GETTER(MapConstructor::symbol_species_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(MapConstructor::symbol_species_getter)
|
||||
{
|
||||
return vm.this_value(global_object);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
private:
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ JS_DEFINE_NATIVE_FUNCTION(MapPrototype::values)
|
|||
}
|
||||
|
||||
// 24.1.3.10 get Map.prototype.size, https://tc39.es/ecma262/#sec-get-map.prototype.size
|
||||
JS_DEFINE_NATIVE_GETTER(MapPrototype::size_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(MapPrototype::size_getter)
|
||||
{
|
||||
auto* map = TRY_OR_DISCARD(typed_this_object(global_object));
|
||||
return Value(map->entries().size());
|
||||
|
|
|
@ -30,7 +30,7 @@ private:
|
|||
JS_DECLARE_NATIVE_FUNCTION(set);
|
||||
JS_DECLARE_NATIVE_FUNCTION(values);
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(size_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(size_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -409,7 +409,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::resolve)
|
|||
}
|
||||
|
||||
// 27.2.4.8 get Promise [ @@species ], https://tc39.es/ecma262/#sec-get-promise-@@species
|
||||
JS_DEFINE_NATIVE_GETTER(PromiseConstructor::symbol_species_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::symbol_species_getter)
|
||||
{
|
||||
return vm.this_value(global_object);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ private:
|
|||
JS_DECLARE_NATIVE_FUNCTION(reject);
|
||||
JS_DECLARE_NATIVE_FUNCTION(resolve);
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ Value RegExpConstructor::construct(FunctionObject&)
|
|||
}
|
||||
|
||||
// 22.2.4.2 get RegExp [ @@species ], https://tc39.es/ecma262/#sec-get-regexp-@@species
|
||||
JS_DEFINE_NATIVE_GETTER(RegExpConstructor::symbol_species_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(RegExpConstructor::symbol_species_getter)
|
||||
{
|
||||
return vm.this_value(global_object);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
private:
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -280,7 +280,7 @@ Value regexp_exec(GlobalObject& global_object, Object& regexp_object, Utf16Strin
|
|||
// 22.2.5.14 get RegExp.prototype.sticky, https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky
|
||||
// 22.2.5.17 get RegExp.prototype.unicode, https://tc39.es/ecma262/#sec-get-regexp.prototype.unicode
|
||||
#define __JS_ENUMERATE(flagName, flag_name, flag_char) \
|
||||
JS_DEFINE_NATIVE_GETTER(RegExpPrototype::flag_name) \
|
||||
JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::flag_name) \
|
||||
{ \
|
||||
auto* regexp_object = TRY_OR_DISCARD(this_object(global_object)); \
|
||||
if (!is<RegExpObject>(regexp_object)) { \
|
||||
|
@ -297,7 +297,7 @@ JS_ENUMERATE_REGEXP_FLAGS
|
|||
#undef __JS_ENUMERATE
|
||||
|
||||
// 22.2.5.4 get RegExp.prototype.flags, https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
||||
JS_DEFINE_NATIVE_GETTER(RegExpPrototype::flags)
|
||||
JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::flags)
|
||||
{
|
||||
auto* regexp_object = TRY_OR_DISCARD(this_object(global_object));
|
||||
StringBuilder builder(8);
|
||||
|
@ -313,7 +313,7 @@ JS_DEFINE_NATIVE_GETTER(RegExpPrototype::flags)
|
|||
}
|
||||
|
||||
// 22.2.5.12 get RegExp.prototype.source, https://tc39.es/ecma262/#sec-get-regexp.prototype.source
|
||||
JS_DEFINE_NATIVE_GETTER(RegExpPrototype::source)
|
||||
JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::source)
|
||||
{
|
||||
auto* regexp_object = TRY_OR_DISCARD(this_object(global_object));
|
||||
if (!is<RegExpObject>(regexp_object)) {
|
||||
|
|
|
@ -24,8 +24,8 @@ public:
|
|||
virtual ~RegExpPrototype() override;
|
||||
|
||||
private:
|
||||
JS_DECLARE_NATIVE_GETTER(flags);
|
||||
JS_DECLARE_NATIVE_GETTER(source);
|
||||
JS_DECLARE_NATIVE_FUNCTION(flags);
|
||||
JS_DECLARE_NATIVE_FUNCTION(source);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(exec);
|
||||
JS_DECLARE_NATIVE_FUNCTION(test);
|
||||
|
@ -38,7 +38,7 @@ private:
|
|||
JS_DECLARE_NATIVE_FUNCTION(compile);
|
||||
|
||||
#define __JS_ENUMERATE(_, flag_name, ...) \
|
||||
JS_DECLARE_NATIVE_GETTER(flag_name);
|
||||
JS_DECLARE_NATIVE_FUNCTION(flag_name);
|
||||
JS_ENUMERATE_REGEXP_FLAGS
|
||||
#undef __JS_ENUMERATE
|
||||
};
|
||||
|
|
|
@ -71,7 +71,7 @@ Value SetConstructor::construct(FunctionObject& new_target)
|
|||
}
|
||||
|
||||
// 24.2.2.2 get Set [ @@species ], https://tc39.es/ecma262/#sec-get-set-@@species
|
||||
JS_DEFINE_NATIVE_GETTER(SetConstructor::symbol_species_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(SetConstructor::symbol_species_getter)
|
||||
{
|
||||
return vm.this_value(global_object);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
private:
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ JS_DEFINE_NATIVE_FUNCTION(SetPrototype::values)
|
|||
}
|
||||
|
||||
// 24.2.3.9 get Set.prototype.size, https://tc39.es/ecma262/#sec-get-set.prototype.size
|
||||
JS_DEFINE_NATIVE_GETTER(SetPrototype::size_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(SetPrototype::size_getter)
|
||||
{
|
||||
auto* set = TRY_OR_DISCARD(typed_this_object(global_object));
|
||||
return Value(set->values().size());
|
||||
|
|
|
@ -28,7 +28,7 @@ private:
|
|||
JS_DECLARE_NATIVE_FUNCTION(has);
|
||||
JS_DECLARE_NATIVE_FUNCTION(values);
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(size_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(size_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ static ThrowCompletionOr<Symbol*> this_symbol_value(GlobalObject& global_object,
|
|||
}
|
||||
|
||||
// 20.4.3.2 get Symbol.prototype.description, https://tc39.es/ecma262/#sec-symbol.prototype.description
|
||||
JS_DEFINE_NATIVE_GETTER(SymbolPrototype::description_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(SymbolPrototype::description_getter)
|
||||
{
|
||||
auto* symbol = TRY_OR_DISCARD(this_symbol_value(global_object, vm.this_value(global_object)));
|
||||
auto& description = symbol->raw_description();
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
virtual ~SymbolPrototype() override;
|
||||
|
||||
private:
|
||||
JS_DECLARE_NATIVE_GETTER(description_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(description_getter);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(to_string);
|
||||
JS_DECLARE_NATIVE_FUNCTION(value_of);
|
||||
|
|
|
@ -143,7 +143,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayConstructor::of)
|
|||
}
|
||||
|
||||
// 23.2.2.4 get %TypedArray% [ @@species ], https://tc39.es/ecma262/#sec-get-%typedarray%-@@species
|
||||
JS_DEFINE_NATIVE_GETTER(TypedArrayConstructor::symbol_species_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(TypedArrayConstructor::symbol_species_getter)
|
||||
{
|
||||
return vm.this_value(global_object);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ private:
|
|||
|
||||
JS_DECLARE_NATIVE_FUNCTION(from);
|
||||
JS_DECLARE_NATIVE_FUNCTION(of);
|
||||
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ static TypedArrayBase* typed_array_species_create(GlobalObject& global_object, T
|
|||
}
|
||||
|
||||
// 23.2.3.18 get %TypedArray%.prototype.length, https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.length
|
||||
JS_DEFINE_NATIVE_GETTER(TypedArrayPrototype::length_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::length_getter)
|
||||
{
|
||||
auto typed_array = typed_array_from_this(global_object);
|
||||
if (!typed_array)
|
||||
|
@ -620,7 +620,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::entries)
|
|||
}
|
||||
|
||||
// 23.2.3.1 get %TypedArray%.prototype.buffer, https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.buffer
|
||||
JS_DEFINE_NATIVE_GETTER(TypedArrayPrototype::buffer_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::buffer_getter)
|
||||
{
|
||||
auto* typed_array = typed_array_from_this(global_object);
|
||||
if (!typed_array)
|
||||
|
@ -631,7 +631,7 @@ JS_DEFINE_NATIVE_GETTER(TypedArrayPrototype::buffer_getter)
|
|||
}
|
||||
|
||||
// 23.2.3.2 get %TypedArray%.prototype.byteLength, https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.bytelength
|
||||
JS_DEFINE_NATIVE_GETTER(TypedArrayPrototype::byte_length_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::byte_length_getter)
|
||||
{
|
||||
auto* typed_array = typed_array_from_this(global_object);
|
||||
if (!typed_array)
|
||||
|
@ -644,7 +644,7 @@ JS_DEFINE_NATIVE_GETTER(TypedArrayPrototype::byte_length_getter)
|
|||
}
|
||||
|
||||
// 23.2.3.3 get %TypedArray%.prototype.byteOffset, https://tc39.es/ecma262/#sec-get-%typedarray%.prototype.byteoffset
|
||||
JS_DEFINE_NATIVE_GETTER(TypedArrayPrototype::byte_offset_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::byte_offset_getter)
|
||||
{
|
||||
auto* typed_array = typed_array_from_this(global_object);
|
||||
if (!typed_array)
|
||||
|
|
|
@ -20,10 +20,10 @@ public:
|
|||
virtual ~TypedArrayPrototype() override;
|
||||
|
||||
private:
|
||||
JS_DECLARE_NATIVE_GETTER(length_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(buffer_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(byte_length_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(byte_offset_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(length_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(buffer_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(byte_length_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(byte_offset_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(to_string_tag_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(at);
|
||||
JS_DECLARE_NATIVE_FUNCTION(every);
|
||||
|
|
|
@ -560,7 +560,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::match_media)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-view/#dom-window-scrollx
|
||||
JS_DEFINE_NATIVE_GETTER(WindowObject::scroll_x_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll_x_getter)
|
||||
{
|
||||
auto* impl = impl_from(vm, global_object);
|
||||
if (!impl)
|
||||
|
@ -569,7 +569,7 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::scroll_x_getter)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-view/#dom-window-scrolly
|
||||
JS_DEFINE_NATIVE_GETTER(WindowObject::scroll_y_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll_y_getter)
|
||||
{
|
||||
auto* impl = impl_from(vm, global_object);
|
||||
if (!impl)
|
||||
|
@ -704,7 +704,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::history_getter)
|
|||
return wrap(global_object, impl->associated_document().history());
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_GETTER(WindowObject::screen_left_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(WindowObject::screen_left_getter)
|
||||
{
|
||||
auto* impl = impl_from(vm, global_object);
|
||||
if (!impl)
|
||||
|
@ -712,7 +712,7 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::screen_left_getter)
|
|||
return JS::Value(impl->screen_x());
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_GETTER(WindowObject::screen_top_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(WindowObject::screen_top_getter)
|
||||
{
|
||||
auto* impl = impl_from(vm, global_object);
|
||||
if (!impl)
|
||||
|
@ -720,7 +720,7 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::screen_top_getter)
|
|||
return JS::Value(impl->screen_y());
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_GETTER(WindowObject::screen_x_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(WindowObject::screen_x_getter)
|
||||
{
|
||||
auto* impl = impl_from(vm, global_object);
|
||||
if (!impl)
|
||||
|
@ -728,7 +728,7 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::screen_x_getter)
|
|||
return JS::Value(impl->screen_x());
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_GETTER(WindowObject::screen_y_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(WindowObject::screen_y_getter)
|
||||
{
|
||||
auto* impl = impl_from(vm, global_object);
|
||||
if (!impl)
|
||||
|
|
|
@ -84,15 +84,15 @@ private:
|
|||
|
||||
JS_DECLARE_NATIVE_FUNCTION(device_pixel_ratio_getter);
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(scroll_x_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(scroll_y_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(scroll_x_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(scroll_y_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(scroll);
|
||||
JS_DECLARE_NATIVE_FUNCTION(scroll_by);
|
||||
|
||||
JS_DECLARE_NATIVE_GETTER(screen_x_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(screen_y_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(screen_left_getter);
|
||||
JS_DECLARE_NATIVE_GETTER(screen_top_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(screen_x_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(screen_y_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(screen_left_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(screen_top_getter);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(alert);
|
||||
JS_DECLARE_NATIVE_FUNCTION(confirm);
|
||||
|
|
|
@ -98,7 +98,7 @@ JS::ThrowCompletionOr<JS::MarkedValueList> ConsoleGlobalObject::internal_own_pro
|
|||
return m_window_object->internal_own_property_keys();
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_GETTER(ConsoleGlobalObject::inspected_node_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(ConsoleGlobalObject::inspected_node_getter)
|
||||
{
|
||||
auto* this_object = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ private:
|
|||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
// Because $0 is not a nice C++ function name
|
||||
JS_DECLARE_NATIVE_GETTER(inspected_node_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(inspected_node_getter);
|
||||
|
||||
Web::Bindings::WindowObject* m_window_object;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue