mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:27:45 +00:00
LibWeb: Make factory method of DOM::Comment fallible
This commit is contained in:
parent
50c5f0d7da
commit
5ef9e02658
2 changed files with 3 additions and 3 deletions
|
@ -16,10 +16,10 @@ Comment::Comment(Document& document, DeprecatedString const& data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-comment-comment
|
// https://dom.spec.whatwg.org/#dom-comment-comment
|
||||||
JS::NonnullGCPtr<Comment> Comment::construct_impl(JS::Realm& realm, DeprecatedString const& data)
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<Comment>> Comment::construct_impl(JS::Realm& realm, DeprecatedString const& data)
|
||||||
{
|
{
|
||||||
auto& window = verify_cast<HTML::Window>(realm.global_object());
|
auto& window = verify_cast<HTML::Window>(realm.global_object());
|
||||||
return realm.heap().allocate<Comment>(realm, window.associated_document(), data).release_allocated_value_but_fixme_should_propagate_errors();
|
return MUST_OR_THROW_OOM(realm.heap().allocate<Comment>(realm, window.associated_document(), data));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class Comment final : public CharacterData {
|
||||||
WEB_PLATFORM_OBJECT(Comment, CharacterData);
|
WEB_PLATFORM_OBJECT(Comment, CharacterData);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static JS::NonnullGCPtr<Comment> construct_impl(JS::Realm&, DeprecatedString const& data);
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Comment>> construct_impl(JS::Realm&, DeprecatedString const& data);
|
||||||
virtual ~Comment() override = default;
|
virtual ~Comment() override = default;
|
||||||
|
|
||||||
virtual DeprecatedFlyString node_name() const override { return "#comment"; }
|
virtual DeprecatedFlyString node_name() const override { return "#comment"; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue