mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 06:25:07 +00:00
LibJS+LibWeb: Add missing JS_DEFINE_ALLOCATOR() for a bunch of classes
This commit is contained in:
parent
11c968fa1f
commit
f4fa37afd2
15 changed files with 25 additions and 3 deletions
|
@ -2563,6 +2563,8 @@ static void generate_named_properties_object_definitions(IDL::Interface const& i
|
||||||
generator.append(R"~~~(
|
generator.append(R"~~~(
|
||||||
#include <LibWeb/WebIDL/AbstractOperations.h>
|
#include <LibWeb/WebIDL/AbstractOperations.h>
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(@named_properties_class@);
|
||||||
|
|
||||||
@named_properties_class@::@named_properties_class@(JS::Realm& realm)
|
@named_properties_class@::@named_properties_class@(JS::Realm& realm)
|
||||||
: JS::Object(realm, nullptr, MayInterfereWithIndexedPropertyAccess::Yes)
|
: JS::Object(realm, nullptr, MayInterfereWithIndexedPropertyAccess::Yes)
|
||||||
, m_realm(realm)
|
, m_realm(realm)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
JS_DECLARE_ALLOCATOR(AsyncFromSyncIteratorPrototype);
|
JS_DEFINE_ALLOCATOR(AsyncFromSyncIteratorPrototype);
|
||||||
|
|
||||||
AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype(Realm& realm)
|
AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype(Realm& realm)
|
||||||
: PrototypeObject(realm.intrinsics().async_iterator_prototype())
|
: PrototypeObject(realm.intrinsics().async_iterator_prototype())
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
namespace JS::Intl {
|
namespace JS::Intl {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(NumberFormatFunction);
|
||||||
|
|
||||||
// 15.5.2 Number Format Functions, https://tc39.es/ecma402/#sec-number-format-functions
|
// 15.5.2 Number Format Functions, https://tc39.es/ecma402/#sec-number-format-functions
|
||||||
NonnullGCPtr<NumberFormatFunction> NumberFormatFunction::create(Realm& realm, NumberFormat& number_format)
|
NonnullGCPtr<NumberFormatFunction> NumberFormatFunction::create(Realm& realm, NumberFormat& number_format)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
class NumberFormatFunction final : public NativeFunction {
|
class NumberFormatFunction final : public NativeFunction {
|
||||||
JS_OBJECT(NumberFormatFunction, NativeFunction);
|
JS_OBJECT(NumberFormatFunction, NativeFunction);
|
||||||
|
JS_DECLARE_ALLOCATOR(NumberFormatFunction);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static NonnullGCPtr<NumberFormatFunction> create(Realm&, NumberFormat&);
|
static NonnullGCPtr<NumberFormatFunction> create(Realm&, NumberFormat&);
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(Symbol);
|
||||||
|
|
||||||
Symbol::Symbol(Optional<String> description, bool is_global)
|
Symbol::Symbol(Optional<String> description, bool is_global)
|
||||||
: m_description(move(description))
|
: m_description(move(description))
|
||||||
, m_is_global(is_global)
|
, m_is_global(is_global)
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
namespace JS::Temporal {
|
namespace JS::Temporal {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(DurationConstructor);
|
||||||
|
|
||||||
// 7.1 The Temporal.Duration Constructor, https://tc39.es/proposal-temporal/#sec-temporal-duration-constructor
|
// 7.1 The Temporal.Duration Constructor, https://tc39.es/proposal-temporal/#sec-temporal-duration-constructor
|
||||||
DurationConstructor::DurationConstructor(Realm& realm)
|
DurationConstructor::DurationConstructor(Realm& realm)
|
||||||
: NativeFunction(realm.vm().names.Duration.as_string(), realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Duration.as_string(), realm.intrinsics().function_prototype())
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
namespace Web::Animations {
|
namespace Web::Animations {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(KeyframeEffect);
|
||||||
|
|
||||||
JS::NonnullGCPtr<KeyframeEffect> KeyframeEffect::create(JS::Realm& realm)
|
JS::NonnullGCPtr<KeyframeEffect> KeyframeEffect::create(JS::Realm& realm)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<KeyframeEffect>(realm, realm);
|
return realm.heap().allocate<KeyframeEffect>(realm, realm);
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
namespace Web::CSS {
|
namespace Web::CSS {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(CSSFontFaceRule);
|
||||||
|
|
||||||
JS::NonnullGCPtr<CSSFontFaceRule> CSSFontFaceRule::create(JS::Realm& realm, FontFace&& font_face)
|
JS::NonnullGCPtr<CSSFontFaceRule> CSSFontFaceRule::create(JS::Realm& realm, FontFace&& font_face)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<CSSFontFaceRule>(realm, realm, move(font_face));
|
return realm.heap().allocate<CSSFontFaceRule>(realm, realm, move(font_face));
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace Web::FileAPI {
|
namespace Web::FileAPI {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(FileList);
|
||||||
|
|
||||||
JS::NonnullGCPtr<FileList> FileList::create(JS::Realm& realm, Vector<JS::NonnullGCPtr<File>>&& files)
|
JS::NonnullGCPtr<FileList> FileList::create(JS::Realm& realm, Vector<JS::NonnullGCPtr<File>>&& files)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<FileList>(realm, realm, move(files));
|
return realm.heap().allocate<FileList>(realm, realm, move(files));
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(CustomElementRegistry);
|
||||||
JS_DEFINE_ALLOCATOR(CustomElementDefinition);
|
JS_DEFINE_ALLOCATOR(CustomElementDefinition);
|
||||||
|
|
||||||
CustomElementRegistry::CustomElementRegistry(JS::Realm& realm)
|
CustomElementRegistry::CustomElementRegistry(JS::Realm& realm)
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(HTMLDataListElement);
|
||||||
|
|
||||||
HTMLDataListElement::HTMLDataListElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
HTMLDataListElement::HTMLDataListElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||||
: HTMLElement(document, move(qualified_name))
|
: HTMLElement(document, move(qualified_name))
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
JS_DECLARE_ALLOCATOR(HTMLDocument);
|
JS_DEFINE_ALLOCATOR(HTMLDocument);
|
||||||
|
|
||||||
HTMLDocument::HTMLDocument(JS::Realm& realm, AK::URL const& url)
|
HTMLDocument::HTMLDocument(JS::Realm& realm, AK::URL const& url)
|
||||||
: Document(realm, url)
|
: Document(realm, url)
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
JS_DECLARE_ALLOCATOR(HTMLElement);
|
JS_DEFINE_ALLOCATOR(HTMLElement);
|
||||||
|
|
||||||
HTMLElement::HTMLElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
HTMLElement::HTMLElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||||
: Element(document, move(qualified_name))
|
: Element(document, move(qualified_name))
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(HTMLTextAreaElement);
|
||||||
|
|
||||||
HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||||
: HTMLElement(document, move(qualified_name))
|
: HTMLElement(document, move(qualified_name))
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(TrackEvent);
|
||||||
|
|
||||||
JS::NonnullGCPtr<TrackEvent> TrackEvent::create(JS::Realm& realm, FlyString const& event_name, TrackEventInit event_init)
|
JS::NonnullGCPtr<TrackEvent> TrackEvent::create(JS::Realm& realm, FlyString const& event_name, TrackEventInit event_init)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<TrackEvent>(realm, realm, event_name, move(event_init));
|
return realm.heap().allocate<TrackEvent>(realm, realm, event_name, move(event_init));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue