1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:37:34 +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

@ -19,15 +19,13 @@ AudioConstructor::AudioConstructor(JS::Realm& realm)
{
}
JS::ThrowCompletionOr<void> AudioConstructor::initialize(JS::Realm& realm)
void AudioConstructor::initialize(JS::Realm& realm)
{
auto& vm = this->vm();
MUST_OR_THROW_OOM(NativeFunction::initialize(realm));
Base::initialize(realm);
define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLAudioElementPrototype>(realm, "HTMLAudioElement"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
return {};
}
JS::ThrowCompletionOr<JS::Value> AudioConstructor::call()

View file

@ -14,7 +14,7 @@ namespace Web::Bindings {
class AudioConstructor final : public JS::NativeFunction {
public:
explicit AudioConstructor(JS::Realm&);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void initialize(JS::Realm&) override;
virtual ~AudioConstructor() override = default;
virtual JS::ThrowCompletionOr<JS::Value> call() override;

View file

@ -19,15 +19,13 @@ ImageConstructor::ImageConstructor(JS::Realm& realm)
{
}
JS::ThrowCompletionOr<void> ImageConstructor::initialize(JS::Realm& realm)
void ImageConstructor::initialize(JS::Realm& realm)
{
auto& vm = this->vm();
Base::initialize(realm);
MUST_OR_THROW_OOM(NativeFunction::initialize(realm));
define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLImageElementPrototype>(realm, "HTMLImageElement"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
return {};
}
JS::ThrowCompletionOr<JS::Value> ImageConstructor::call()

View file

@ -14,7 +14,7 @@ namespace Web::Bindings {
class ImageConstructor final : public JS::NativeFunction {
public:
explicit ImageConstructor(JS::Realm&);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void initialize(JS::Realm&) override;
virtual ~ImageConstructor() override = default;
virtual JS::ThrowCompletionOr<JS::Value> call() override;

View file

@ -21,15 +21,13 @@ OptionConstructor::OptionConstructor(JS::Realm& realm)
{
}
JS::ThrowCompletionOr<void> OptionConstructor::initialize(JS::Realm& realm)
void OptionConstructor::initialize(JS::Realm& realm)
{
auto& vm = this->vm();
Base::initialize(realm);
MUST_OR_THROW_OOM(NativeFunction::initialize(realm));
define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLOptionElementPrototype>(realm, "HTMLOptionElement"), 0);
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
return {};
}
JS::ThrowCompletionOr<JS::Value> OptionConstructor::call()

View file

@ -14,7 +14,7 @@ namespace Web::Bindings {
class OptionConstructor final : public JS::NativeFunction {
public:
explicit OptionConstructor(JS::Realm&);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void initialize(JS::Realm&) override;
virtual ~OptionConstructor() override = default;
virtual JS::ThrowCompletionOr<JS::Value> call() override;