mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +00:00
LibWeb: Make factory method of Encoding::TextEncoder fallible
This commit is contained in:
parent
77e4432367
commit
d7446089ae
2 changed files with 4 additions and 3 deletions
|
@ -8,12 +8,13 @@
|
||||||
#include <LibJS/Runtime/TypedArray.h>
|
#include <LibJS/Runtime/TypedArray.h>
|
||||||
#include <LibWeb/Bindings/Intrinsics.h>
|
#include <LibWeb/Bindings/Intrinsics.h>
|
||||||
#include <LibWeb/Encoding/TextEncoder.h>
|
#include <LibWeb/Encoding/TextEncoder.h>
|
||||||
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||||
|
|
||||||
namespace Web::Encoding {
|
namespace Web::Encoding {
|
||||||
|
|
||||||
JS::NonnullGCPtr<TextEncoder> TextEncoder::construct_impl(JS::Realm& realm)
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<TextEncoder>> TextEncoder::construct_impl(JS::Realm& realm)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<TextEncoder>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors();
|
return MUST_OR_THROW_OOM(realm.heap().allocate<TextEncoder>(realm, realm));
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEncoder::TextEncoder(JS::Realm& realm)
|
TextEncoder::TextEncoder(JS::Realm& realm)
|
||||||
|
|
|
@ -20,7 +20,7 @@ class TextEncoder final : public Bindings::PlatformObject {
|
||||||
WEB_PLATFORM_OBJECT(TextEncoder, Bindings::PlatformObject);
|
WEB_PLATFORM_OBJECT(TextEncoder, Bindings::PlatformObject);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static JS::NonnullGCPtr<TextEncoder> construct_impl(JS::Realm&);
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<TextEncoder>> construct_impl(JS::Realm&);
|
||||||
|
|
||||||
virtual ~TextEncoder() override;
|
virtual ~TextEncoder() override;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue