mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:27:43 +00:00
LibWeb: Make factory method of Crypto::Crypto fallible
This commit is contained in:
parent
fb3294863e
commit
58af8e2021
3 changed files with 4 additions and 4 deletions
|
@ -14,9 +14,9 @@
|
||||||
|
|
||||||
namespace Web::Crypto {
|
namespace Web::Crypto {
|
||||||
|
|
||||||
JS::NonnullGCPtr<Crypto> Crypto::create(JS::Realm& realm)
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<Crypto>> Crypto::create(JS::Realm& realm)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<Crypto>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
return MUST_OR_THROW_OOM(realm.heap().allocate<Crypto>(realm, realm));
|
||||||
}
|
}
|
||||||
|
|
||||||
Crypto::Crypto(JS::Realm& realm)
|
Crypto::Crypto(JS::Realm& realm)
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Crypto : public Bindings::PlatformObject {
|
||||||
WEB_PLATFORM_OBJECT(Crypto, Bindings::PlatformObject);
|
WEB_PLATFORM_OBJECT(Crypto, Bindings::PlatformObject);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static JS::NonnullGCPtr<Crypto> create(JS::Realm&);
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Crypto>> create(JS::Realm&);
|
||||||
|
|
||||||
virtual ~Crypto() override;
|
virtual ~Crypto() override;
|
||||||
|
|
||||||
|
|
|
@ -1067,7 +1067,7 @@ void Window::initialize_web_interfaces(Badge<WindowEnvironmentSettingsObject>)
|
||||||
|
|
||||||
Object::set_prototype(&Bindings::ensure_web_prototype<Bindings::WindowPrototype>(realm, "Window"));
|
Object::set_prototype(&Bindings::ensure_web_prototype<Bindings::WindowPrototype>(realm, "Window"));
|
||||||
|
|
||||||
m_crypto = Crypto::Crypto::create(realm);
|
m_crypto = Crypto::Crypto::create(realm).release_value_but_fixme_should_propagate_errors();
|
||||||
|
|
||||||
// FIXME: These should be native accessors, not properties
|
// FIXME: These should be native accessors, not properties
|
||||||
define_native_accessor(realm, "top", top_getter, nullptr, JS::Attribute::Enumerable);
|
define_native_accessor(realm, "top", top_getter, nullptr, JS::Attribute::Enumerable);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue