1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibJS: Make Cell::initialize() return void

Stop worrying about tiny OOMs.

Work towards #20405
This commit is contained in:
Andreas Kling 2023-08-07 08:41:28 +02:00
parent fde26c53f0
commit 18c54d8d40
804 changed files with 1330 additions and 2171 deletions

View file

@ -139,12 +139,10 @@ Blob::Blob(JS::Realm& realm, ByteBuffer byte_buffer)
Blob::~Blob() = default;
JS::ThrowCompletionOr<void> Blob::initialize(JS::Realm& realm)
void Blob::initialize(JS::Realm& realm)
{
MUST_OR_THROW_OOM(Base::initialize(realm));
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::BlobPrototype>(realm, "Blob"));
return {};
}
// https://w3c.github.io/FileAPI/#ref-for-dom-blob-blob

View file

@ -53,7 +53,7 @@ protected:
Blob(JS::Realm&, ByteBuffer, String type);
Blob(JS::Realm&, ByteBuffer);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void initialize(JS::Realm&) override;
private:
WebIDL::ExceptionOr<JS::NonnullGCPtr<Streams::ReadableStream>> get_stream();

View file

@ -19,12 +19,10 @@ File::File(JS::Realm& realm, ByteBuffer byte_buffer, String file_name, String ty
{
}
JS::ThrowCompletionOr<void> File::initialize(JS::Realm& realm)
void File::initialize(JS::Realm& realm)
{
MUST_OR_THROW_OOM(Base::initialize(realm));
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::FilePrototype>(realm, "File"));
return {};
}
File::~File() = default;

View file

@ -31,7 +31,7 @@ public:
private:
File(JS::Realm&, ByteBuffer, String file_name, String type, i64 last_modified);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void initialize(JS::Realm&) override;
String m_name;
i64 m_last_modified { 0 };

View file

@ -24,12 +24,10 @@ FileList::FileList(JS::Realm& realm, Vector<JS::NonnullGCPtr<File>>&& files)
FileList::~FileList() = default;
JS::ThrowCompletionOr<void> FileList::initialize(JS::Realm& realm)
void FileList::initialize(JS::Realm& realm)
{
MUST_OR_THROW_OOM(Base::initialize(realm));
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::FileListPrototype>(realm, "FileList"));
return {};
}
// https://w3c.github.io/FileAPI/#dfn-item

View file

@ -42,7 +42,7 @@ public:
private:
FileList(JS::Realm&, Vector<JS::NonnullGCPtr<File>>&&);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
// ^Bindings::LegacyPlatformObject